Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- lockfile=/tmp/cycle_desktop_space.lock
- if [ -f $lockfile ]
- then
- exit 1
- fi
- touch $lockfile
- trap 'rm "$lockfile"' EXIT
- cur_space=`wmctrl -d | grep "*" | cut -d ' ' -f 1`
- num_spaces=`wmctrl -d | tail -1 | cut -d ' ' -f 1`
- if [ $num_spaces -eq 2 ] && [ $cur_space -eq 1 ] ; then
- cur_space=-1
- fi
- wmctrl -s $((($cur_space + 1) % ($num_spaces+1)))
- sleep .3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement