Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #check if xdotool is installed
  4. if [ ! -n "$(dpkg -s xdotool 2>/dev/null | grep 'Status: install ok installed')" ]; then
  5. echo -e "The package 'xdotool' must to be installed before to run $(basename $0)\nUse 'sudo apt-get install xdotool' command in terminal to install it."
  6. exit
  7. fi
  8.  
  9. delay=5 #change as you wish
  10.  
  11. echo "Press Ctrl+C to finish"
  12.  
  13. #start with workspace 0 (top left)
  14. xdotool key Ctrl+Alt+Left
  15. xdotool key Ctrl+Alt+Up
  16.  
  17. #switch workspaces
  18. while : ; do
  19. workspace_nr=0
  20. until [ $workspace_nr = 4 ]; do
  21. sleep $delay
  22. case $workspace_nr in
  23. 0) xdotool key Ctrl+Alt+Right ;;
  24. 1) xdotool key Ctrl+Alt+Down ;;
  25. 2) xdotool key Ctrl+Alt+Left ;;
  26. 3) xdotool key Ctrl+Alt+Up ;;
  27. esac
  28. ((workspace_nr++))
  29. done
  30. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement