Skip to content

Instantly share code, notes, and snippets.

@valarauca
Created May 22, 2020 19:03
Show Gist options
  • Save valarauca/881f4cd9aa2a3251f2024970e3a78874 to your computer and use it in GitHub Desktop.
Save valarauca/881f4cd9aa2a3251f2024970e3a78874 to your computer and use it in GitHub Desktop.
causes your mouse to move so you look online
#!/bin/bash
hash xdotool &>/dev/null || {
echo -e "failed to find xdotool.\nPlease install xdotool" >&2;
exit 1;
}
function move_mouse() {
declare -i distance="${1}"
declare -i angle="${2}"
xdotool mousemove_relative --polar "${angle}" "${distance}"
}
function main() {
for ((;;)); do
local random_angle="$(shuf -i1-360 -n1)"
local random_distance="$(shuf -i1-5 -n1)"
move_mouse "${random_angle}" "${random_distance}"
sleep 30s
done
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment