Closed rwijtvliet closed 1 year ago
Concretely:
currently, when starting sketchybar, all spaces are looped through, and assigned an icon in that order. The index number of the space is used as its identifier, but this number changes.
I was wondering if there is a more permanent identifier that can be used, e.g. the UUID or the yabai label - if these are accessible to the sketchybarrc
script.
For my purposes, it is sufficient if the correct order is assumed when sketchybar is started (i.e., that the first space is indeed the one labelled 1_files
, the second one is 2_www
, etc.). But a more robust solution would be to create an associative SPACE_ICONS
array, like so:
SPACE_ICONS=(
1_files="1 <filebrowser icon>"
2_www="2 <firefox icon>"
...
)
Thinking about it some more, yabai -m query --spaces
could be used to find the relation between mission control index and yabai label. And the aforementioned associative array can be used to find the label to show in sketchybar.
It's a bit roundabout, but at least the information is there.
Excuse me in advance if this is a bit scatterbrained or already has a solution. I searched in the issue history but couldn't find anything related, though I assume I'm not the first person to experience it.
In yabai, I define several workspaces, e.g.
1_files
,2_www
, etc. I also set-up key bindings inskhd
to switch to these workspaces withhotkey+1
,hotkey+2
etc. This works, and the correct workspace is focused, regardless of the monitor it's on or its current position in mission control.My issue in sketchybar is that the icons/labels I assign each space are dependent on each space's position in mission control. If I move space
2_www
, which has the firefox logo, to the next display, the firefox icon gets 'assigned' to the next workspace on the original monitor - i.e., to the one that takes its place in the mission control space order. The workspace2_www
now has the incorrect icon, too. (If I move the space back to the original monitor, the original order is not restored in mission control, but that is a yabai issue)Is there a way to connect the
space
to a yabai space name?