Closed PhrantiK closed 1 year ago
This will work perfectly if you set sketchybar --set hide2 updates=on
because I presume it is currently set to when_shown
, hence it will not call its script when the item is not drawn to screen.
PEBKAC - Thanks Felix!
Edit: Leaving this here for posterity.
Been mucking about with the helper program to do this instead of adding an item and got it working:
add mach_helper=$HELPER
to the spaces config and add this to the helper:
else if (strcmp(sender, "space_change") == 0) {
// turn the bar off on D1S2
char *dos = strstr(info, "{\n\t\"display-1\": 2\n}");
char command[256];
char *hide;
hide = dos ? "on" : "off";
snprintf(command, 256, "--bar hidden=%s", hide);
sketchybar(command);
}
Makes it instant. Thanks again for the awesome software!
Trying to figure out the best way to hide a bar for a specific space. Noticed we can do it by display (#42) and also saw another issue with a bunch of yabai signals (https://github.com/FelixKratz/SketchyBar/issues/175#issuecomment-1084409282).
Is it possible to do it with an item & space_change event to keep things a bit faster & leaner?
ITEM:
PLUGIN:
It works great but when the bar is hidden, $INFO stops outputting so the bar stays hidden. Not sure if that's by design, a bug or feature request. Thanks!