My i3 configurations and scripts.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

i3_move_mouse.sh 513B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. DIRECTION=$1
  3. getMouseX() {
  4. xdotool getmouselocation 2>/dev/null | awk '{ print $1 }' | cut -d: -f2
  5. }
  6. getMouseY() {
  7. xdotool getmouselocation 2>/dev/null | awk '{ print $2 }' | cut -d: -f2
  8. }
  9. moveTo() {
  10. xdotool mousemove $1 $2
  11. }
  12. case $DIRECTION in
  13. left) moveTo $(echo "$(getMouseX)-20" | bc) $(getMouseY);;
  14. right) moveTo $(echo "$(getMouseX)+20" | bc) $(getMouseY);;
  15. up) moveTo $(getMouseX) $(echo "$(getMouseY)-20" | bc) ;;
  16. down) moveTo $(getMouseX) $(echo "$(getMouseY)+20" | bc);;
  17. esac