Last active
July 19, 2018 09:09
-
-
Save dandanwei/35eb855cf16058734453dbef411667cf to your computer and use it in GitHub Desktop.
Jump mouse cursor between 2 screens and remember the last location
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
> git clone https://github.com/BlueM/cliclick.git | |
> cd cliclick | |
> make | |
> echo '800,10' > ~/.screen_jump | |
copy cliclick to /usr/local/bin/ | |
copy screen_jump.sh to /usr/local/bin | |
prepare automator or applescript or BetterTouchTool to run the terminal script /usr/local/bin | |
DONE! |
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 | |
CURRENT_COORD=$(/usr/local/bin/cliclick "p") | |
TARGET_COORD=`cat ~/.screen_jump` | |
ABSOLUTE_TARGET_COORD="${TARGET_COORD//-/=-}" | |
/usr/local/bin/cliclick "m:${ABSOLUTE_TARGET_COORD}" | |
if [ $CURRENT_COORD != $TARGET_COORD ]; then | |
echo $CURRENT_COORD > ~/.screen_jump | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment