Skip to content

Instantly share code, notes, and snippets.

@vivien
Last active March 23, 2018 11:05
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vivien/617e5dcb809b65d16c2f to your computer and use it in GitHub Desktop.
Save vivien/617e5dcb809b65d16c2f to your computer and use it in GitHub Desktop.
Jump to the next available workspace, on the current screen. If you use 1, 2 and 5, it'll jump to workspace 3.
#!/bin/bash
map_num () {
tr , '\n' | grep '"num":' | cut -d: -f2
# equivalent to jshon -a -e num
echo 11
}
next_min () {
sort -n | cat -n | awk '{ if ($1 != $2) { print $1; exit } }'
}
i3-msg -t get_workspaces | map_num | next_min | xargs i3-msg workspace number
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment