-
-
Save Yanik39/aa884291a58584447860bae30e4fbee1 to your computer and use it in GitHub Desktop.
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 | |
/usr/bin/logger -t Move "Starting" | |
while :; do | |
if [ $(xprintidle) -gt 57000 ] | |
then | |
if [[ $(/usr/bin/wmctrl -l | grep Brave | wc -l) -ge 1 ]] | |
then | |
/usr/bin/logger -t Move "Moving" | |
#/usr/bin/wmctrl -l | grep Brave | grep -v Mozilla | sed -ne 's|^\([^ ]*\).*Brave.*|\1|p' | |
#/usr/bin/wmctrl -R Brave | |
#/usr/bin/wmctrl -iR $(/usr/bin/wmctrl -l | grep Brave | grep -v 'Mozilla\|Inbox' | sed -ne 's|^\([^ ]*\).*Brave.*|\1|p') | |
/usr/bin/wmctrl -iR $(/usr/bin/wmctrl -l | grep -E ' - Brave' | grep -v ' — Mozilla Thunderbird\| — Mozilla Firefox' | sed -ne 's|^\([^ ]*\).*Brave.*|\1|p') | |
/usr/bin/xdotool sleep 0.5 | |
#/usr/bin/xdotool mousemove_relative --sync -- '-50' '-50' | |
#/usr/bin/xdotool sleep 0.1 | |
#/usr/bin/xdotool mousemove_relative --sync '50' '50' | |
/usr/bin/xdotool mousemove --sync $(($(rand -M 800) + 300)) $(($(rand -M 500) + 200)) | |
/usr/bin/xdotool sleep 0.2 | |
/usr/bin/xdotool key "ctrl+1" | |
/usr/bin/xdotool sleep 0.3 | |
/usr/bin/xdotool key F5 | |
#/usr/bin/xdotool windowactivate $(/usr/bin/xdotool search --class brave | /usr/bin/tail -1) key "ctrl+1" F5 | |
else | |
/usr/bin/logger -t Move "No Brave Browser found!" | |
fi | |
else | |
/usr/bin/logger -t Move "User not idle!" | |
fi | |
sleep 63 | |
done & | |
echo $(($$ + 2)) | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment