Created
November 12, 2014 15:03
-
-
Save wojtha/e9ed6f355e2222875a50 to your computer and use it in GitHub Desktop.
xdotool - scripting X11 from command line
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
# Absolute switching | |
xdotool set_desktop 0 | |
xdotool set_desktop 1 | |
xdotool set_desktop 2 | |
xdotool set_desktop 3 | |
# Relative switching | |
xdotool set_desktop $(echo $(($(xdotool get_desktop) + 1))) | |
xdotool set_desktop $(echo $(($(xdotool get_desktop) - 1))) | |
# What about the max num of desktops? | |
echo $(( ( $(xdotool get_desktop) + 1 ) % $(xdotool get_num_desktops))) | |
echo $(( ( $(xdotool get_desktop) - 1 ) % $(xdotool get_num_desktops))) | |
# Hmm, but we can get -1 and bash has no abs() function | |
# Bit hey there is a undocumented --relative argument! | |
xdotool set_desktop --relative -- 1 | |
xdotool set_desktop --relative -- -1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment