I need to run shell script contains Xdotool codes in /home/z/Desktop/tempo/run.sh
. I've tried many ways of DISPLAY=:0
but always not works.
I've tried each of below codes, and not works:
* * * * * export DISPLAY=:0 cd /home/z/Desktop/tempo; ./run.sh
* * * * * export DISPLAY=:0; cd /home/z/Desktop/tempo; ./run.sh
* * * * * export DISPLAY=:0 && cd /home/z/Desktop/tempo; ./run.sh
* * * * * DISPLAY=:0 cd /home/z/Desktop/tempo; ./run.sh
* * * * * DISPLAY=:0; cd /home/z/Desktop/tempo; ./run.sh
* * * * * DISPLAY=:0 && cd /home/z/Desktop/tempo; ./run.sh
Running directly also not works:
* * * * * export DISPLAY=:0 xdotool mousemove 20 20
* * * * * export DISPLAY=:0; xdotool mousemove 20 20
* * * * * export DISPLAY=:0 && xdotool mousemove 20 20
* * * * * DISPLAY=:0 xdotool mousemove 20 20
* * * * * DISPLAY=:0; xdotool mousemove 20 20
* * * * * DISPLAY=:0 && xdotool mousemove 20 20
I always don't see my mouse moving on each line of codes above.
I've also tested Xdotool codes to make invalid website URI request and see the logs. Sadly the logs still blank.
XAUTHORITY
variable before calling X utilite from cron.xhost +
might work. Not recommended unless you are alone behind a firewall, though; it disables all X11 host access checks.xhost -
to revert to the default behavior.stdout
andstderr
of the scripts to a file and check what messages appear there.