Menu Close

ZSH/Bash Reference

xdotool getmouselocation
#get the x, y co-ordinates and screen number and window info.
xdotool mousemove x y click 1
#move the mouse cursor to x,y position and left click (click 2 for rmb, click 3 for mmb).
xdotool mousemove x y click --repeat 2 1
#move cursor to x y location and double click with lmb (--repeat location is  important, needs to be after click but before button identifier!)
xdotool key --clearmodifiers x
#types the keyboard character 'x', see man page for --clearmodifiers, other options are clear etc. shift + a, ctrl + c.
sleep $(shuf -i 10-20 -n1)
#sleep for a random time between 10-20 seconds.
fruit=( "apple" "orange" "grape" "banana")
echo $(shuf -n1 -e "${fruit[@]}")
#Each echo command will randomly output one of the fruits.
shuf -n1 filename
#take random entry from within the file if it's in the same folder as the script
#Switches VPN server every hour.

#List of server locations.
servers=( "connect us" "connect uk" "connect fr" "connect es" "connect dk" "connect ca" )

#Connect to a random server from the array, wait 1 hour and connect to another random server from the array.
$(shuf -n1 -e "${servers[@]}")
sleep 3600