-
-
Save mpalourdio/a0b122a4a689f2877cb79e2fa57161cb to your computer and use it in GitHub Desktop.
Linux: Move mouse randomly every X seconds
This file contains hidden or 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 | |
| DELAY=$1 | |
| if [ -z $DELAY ]; then | |
| echo "Error: missing delay -> $0 <delay in seconds>" | |
| exit 1 | |
| fi | |
| while true; do | |
| # Get screen dimensions (adjust to your actual screen size) | |
| WIDTH=1920 | |
| HEIGHT=1080 | |
| # Generate random coordinates | |
| X=$((RANDOM % WIDTH)) | |
| Y=$((RANDOM % HEIGHT)) | |
| # Move mouse | |
| xdotool mousemove $X $Y | |
| echo "Moved to: $X, $Y at $(date)" | |
| # Wait $DELAY seconds | |
| sleep $DELAY | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment