I tried to set up wallpaper change via cron in /etc/crontab
, but I failed.
DISPLAY env set directly / before cmd, but still it's not working:
DISPLAY=:0.0
* * * * * ad env DISPLAY=:0.0 /usr/bin/awsetbg -a -r /home/ad/img/beauty/
* * * * * ad DISPLAY=:0.0 /usr/bin/awsetbg -a -r /home/ad/img/beauty/
* * * * * ad export DISPLAY=:0.0; /usr/bin/awsetbg -a -r /home/ad/img/beauty/
su - user -c "cmd"
worked:
* * * * * root su - ad -c "DISPLAY=:0.0 /usr/bin/awsetbg -a -r /home/ad/img/beauty/"
Now I'm using user's crontab (crontab -e
) which works fine:
*/10 * * * * DISPLAY=:0.0 /usr/bin/awsetbg -a -r /home/ad/img/beauty/
What else do I have to set?
cron's env
:
MAILTO=root
SHELL=/bin/bash
USER=ad
PATH=/sbin:/bin:/usr/sbin:/usr/bin
PWD=/
SHLVL=1
HOME=/
LOGNAME=ad
DISPLAY=:0.0 # same result for DISPLAY=:0
_=/bin/env
Using vixie-cron 4.1-r1
on Gentoo.