xfdesktop in a cron job

Mike Massonnet mmassonnet at gmail.com
Sun Dec 11 19:35:55 CET 2011

2011/11/25 houghi <houghi at houghi.org>:
> On Fri, Nov 25, 2011 at 02:32:05AM +0100, TRINH Minh Hieu wrote:
>> I also have OpenSuse 12.1 installed. I confirm that :
>> DISPLAY=:0.0 xfdesktop --reload
>> "worked". There is no error message but the wallpaper don't change. Because
>> "xfdesktop --reload" don't seems to not re-read the configuration file.
> OK. Good to know. The fact that the wallpapers did not change is normal as
> there are no changes in the wallpaper settings.
>> With Xfce 4.8, use "xfconf-query". I tried this in cron and it works :
>> DISPLAY=:0.0 xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/
>> image-path -s /home/mhtrinh/myconf/vladstudio_infinity_1_gold_1366x768.jpg
> Also does not seem to work. As was sugested, I am apparently unable to get
> the correct connection from cron for GUI. :-/

Here is a small script I once wrote, that ensures DBus is functional
in cron tasks:

if [ -z "${DBUS_SESSION_BUS_ADDRESS}" ] ; then
        . ${HOME}/.dbus/session-bus/`ls -rt ${HOME}/.dbus/session-bus/
| tail -1`
IMAGE_PATH=`xfconf-query -c xfce4-desktop -p ${PROPERTY}`
xfconf-query -c xfce4-desktop -p ${PROPERTY} -s ""
xfconf-query -c xfce4-desktop -p ${PROPERTY} -s "${IMAGE_PATH}"


More information about the Xfce mailing list