Skip to content

Instantly share code, notes, and snippets.

@LC43
Last active May 14, 2022 00:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LC43/e31a3ceb8f5f5f31e6838022991a4024 to your computer and use it in GitHub Desktop.
Save LC43/e31a3ceb8f5f5f31e6838022991a4024 to your computer and use it in GitHub Desktop.
Send window to next workspace
#!/bin/bash
## workspace Number ( count )
WS_N=$(wmctrl -d | wc -l)
## workspace ID
WS_ID=$(wmctrl -d | grep '*' | cut -d ' ' -f1)
## next workspace id ( loops around )
NEXT_ID=$(( ( $WS_ID + 1 ) % $WS_N ));
wmctrl -r :ACTIVE: -t "${NEXT_ID}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment