I've written a little script createCountdownWallpaper.py
that is supposed to re-render the wallpaper /tmp/wallpaper.png
every few minutes, and a script setWallpaper.sh
that looks as follows:
#!/bin/bash
cd /home/path/to/countdown
/usr/bin/python3.5 createCountdownWallpaper.py
xfconf-query \
--channel xfce4-desktop \
--property /backdrop/screen0/monitor0/workspace0/last-image \
--set /tmp/wallpaper.png
The channels and property
have been selected using -m
flag of xfconf-query
, as described in this answer. It works when run from the terminal. However, when run from cron
, it seems to have no effect. Crontab:
SHELL=/bin/bash
*/1 * * * * /home/path/to/countdown/setWallpaper.sh 2>/tmp/cron_errors.txt
I've also tried sourcing various .bashrc
and .profile
scripts and setting environment variables like
DBUS_SESSION_BUS_ADDRESS=unix:abstract=tmp/dbus-r4nd0MjunK
but it didn't help either.