Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #!/bin/bash
  2. lockfile=/tmp/cycle_desktop_space.lock
  3. if [ -f $lockfile ]
  4. then
  5. exit 1
  6. fi
  7. touch $lockfile
  8. trap 'rm "$lockfile"' EXIT
  9. cur_space=`wmctrl -d | grep "*" | cut -d ' ' -f 1`
  10. num_spaces=`wmctrl -d | tail -1 | cut -d ' ' -f 1`
  11. if [ $num_spaces -eq 2 ] && [ $cur_space -eq 1 ] ; then
  12. cur_space=-1
  13. fi
  14. wmctrl -s $((($cur_space + 1) % ($num_spaces+1)))
  15. sleep .3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement