I wrote the following crontab task which should switch my backgound image every 10 minutes on linux mint:
*/10 * * * * /home/me/Pictures/wallpapers/switcher.sh >> /home/me/Logs/wallpaper.log 2>&1
Which calls this shell script:
#!/bin/bash
gsettings set org.cinnamon.desktop.background picture-uri $(/usr/bin/python3 /home/me/Pictures/wallpapers/spaceBack.py)
In the log file I get this error message:
(process:18951): dconf-CRITICAL **: 14:00:02.264: unable to create file '/home/me/.cache/dconf/user': Permission denied. dconf will not work properly.
(process:18951): dconf-CRITICAL **: 14:00:02.265: unable to create file '/home/me/.cache/dconf/user': Permission denied. dconf will not work properly.
(process:18951): dconf-CRITICAL **: 14:00:02.265: unable to create file '/home/me/.cache/dconf/user': Permission denied. dconf will not work properly.
(process:18951): dconf-WARNING **: 14:00:02.265: failed to commit changes to dconf: Cannot autolaunch D-Bus without X11 $DISPLAY
I only get this error when running the shell script via cron
(it works fine via terminal).
calling ls -la /home/me/.cache/dconf/
Returns
drwx------ 2 root root 4096 Jul 6 16:13 .
drwx------ 48 me me 4096 Jun 29 15:33 ..
-rw------- 1 root root 2 Jul 6 16:13 user
echo $DISPLAY
and place the resulting value in your cron command like so:DISPLAY=<value returned from echo> /home/me/Pictures/wallpapers/switcher.sh [...]
– Panki Jul 6 '20 at 13:53... (process:21877): dconf-WARNING **: 16:04:05.657: failed to commit changes to dconf: Could not connect: Connection refused
the DISPLAY value is:0
– Chris Jul 6 '20 at 14:04crontab
running as? – Panki Jul 6 '20 at 15:06me
– Chris Jul 6 '20 at 15:12