Created
November 26, 2022 13:08
-
-
Save koenhendriks/7004a947cdf29d8b333892c871e8e293 to your computer and use it in GitHub Desktop.
Workspace switcher from CLI for CInnamon
This file contains 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
#!/usr/bin/env bash | |
current=`xdotool get_desktop` | |
max=`xdotool get_num_desktops` | |
if [ "$1" = "left" ]; then | |
desktop=`expr $current - 1` | |
elif [ "$1" = "right" ]; then | |
desktop=`expr $current + 1` | |
else | |
echo "Invalid argument, should be either 'left' or 'right' "; | |
exit 2; | |
fi | |
if [ $desktop -le $max ] && [ $desktop -ge 0 ]; then | |
xdotool set_desktop $desktop | |
fi | |
exit 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment