Skip to content

Instantly share code, notes, and snippets.

@patrickhpan
Created July 23, 2020 19:20
Show Gist options
  • Select an option

  • Save patrickhpan/d3d4ee7f6e4a4c3449c1aa27d316d02b to your computer and use it in GitHub Desktop.

Select an option

Save patrickhpan/d3d4ee7f6e4a4c3449c1aa27d316d02b to your computer and use it in GitHub Desktop.
yabai -m query --spaces | jq 'reverse | .[] | select(.windows | length == 0).index' | while read id; do yabai -m space $id --destroy; done
@patrickhpan
Copy link
Author

I set this up as an every-15-minute crontab. You might need to append the install path for yabai and jq (perhaps/usr/local/bin?) to your $PATH in this script to make sure cron has access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment