Created
July 2, 2013 11:24
-
-
Save swarminglogic/5908530 to your computer and use it in GitHub Desktop.
Script to move mouse cursor to the specified screen (for separate x screens).
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
#!/bin/bash | |
# Script to move mouse cursor to the specified screen (for separate x screens). | |
# Useful if set up to trigger with a global hotkey. | |
# | |
# e.g.: ./focusscreen.sh 0 | |
# | |
if [ ! `which xdotool` ] ; then echo "You need xdotool!" && exit ; fi | |
eval $(xdotool getmouselocation --shell 2>/dev/null) | |
screen=$SCREEN; | |
if [[ $# -eq 0 ]] ; then exit ; fi | |
if [[ $1 -eq $screen ]] ; then exit ; fi | |
xdotool mousemove --screen $1 300 5 | |
# TODO swarminglogic, 2013-07-02: Store screen and mouse position in file when | |
# switching to a different screen. Check if | |
# information is available, and if so, move to | |
# this position if moving to this screen. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment