SxC97 / Yabai-Spaces

A *crazy* customizable Bitbar plugin that displays the total number of spaces and highlights the current one.
37 stars 0 forks source link

Cant detect current space after upgrade to yabai #2

Open soulflyer opened 2 years ago

soulflyer commented 2 years ago

Yabai version 4 has some breaking changes. One is that the info returned by yabai -m query --spaces specifies the current space by has-focus true rather than focussed 1

Change line 120 of yabai.1d.sh or whatever equivalent file you have installed to the following to fix this:

CURRENT=$(yabai -m query --spaces --display | jq 'map(select(."has-focus" == true))[-1].index')
soulflyer commented 2 years ago

Similarly for the $WINDOW setting that is used to show if a window is floating or managed. Change line 174 from: WINDOW=$(yabai -m query --windows --window | jq .floating) 2> /dev/null to: WINDOW=$(yabai -m query --windows --window | jq '."is-floating"') 2> /dev/null The subsequent test of the returned value will also need to be changed as it is now true/false not 0/1