Last active
May 14, 2022 00:18
-
-
Save LC43/e45eb381e87f5db43279979e7141bc63 to your computer and use it in GitHub Desktop.
Send window to previous workspace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## workspace Number ( count ) | |
WS_N=$(wmctrl -d | wc -l) | |
## workspace ID | |
WS_ID=$(wmctrl -d | grep '*' | cut -d ' ' -f1) | |
## previous workspace id ( loops around ) | |
PREV_ID=$(( ( $WS_ID - 1 ) % $WS_N )); | |
if [ $PREV_ID -lt 0 ]; then PREV_ID=$(( $PREV_ID+ $WS_N )); fi | |
wmctrl -r :ACTIVE: -t "${PREV_ID}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment