-
I guess I have something wrong here but I can't see it. Maybe someone here could help me. Objective: Empty spaces should be destroyed when switched to another space. (To cleanup unused spaces) Here is my code for achieving this: Any Ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I finaly figured it out myself. The problem was that spaces have an "id" and an independent "index":
|
Beta Was this translation helpful? Give feedback.
-
Awesome, thank you for this! :) |
Beta Was this translation helpful? Give feedback.
I finaly figured it out myself. The problem was that spaces have an "id" and an independent "index":
If anyone is interessted here is the code that works:
yabai -m signal --add event=space_changed action='RSINDEX=$(yabai -m query --spaces | jq ".[] | select (.id == $YABAI_RECENT_SPACE_ID) | .index") && if [ "$(yabai -m query --spaces --space $RSINDEX | jq -re '.windows')" = "[]" ] ; then yabai -m space $RSINDEX --destroy ; fi'