2009-03-11

Refresh the Xfce background

In Xfce 4.4 there was a little hack that worked to refresh the background. I managed to get the same result for Xfce 4.6 with the following "hack":
#!/bin/sh
if [ -z "${DBUS_SESSION_BUS_ADDRESS}" ] ; then
        . ${HOME}/.dbus/session-bus/`ls -rt ${HOME}/.dbus/session-bus/ | tail -1`
        export DBUS_SESSION_BUS_ADDRESS
fi
PATH=/usr/local/bin:${PATH}
MONITOR=${1:-0}
PROPERTY="/backdrop/screen0/monitor${MONITOR}/image-path"
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}"
Now when will this be useful? Barely never. Still enjoy it :-)

Update: script snipped updated to run within a cronjob.

4 comments:

  1. I don't know if XFCE supports one wallpaper per workspace but GNOME doesn't so some guys created wallpapoz which is a process running in the background which watches for the workspace changes and then changes the wallpaper. Maybe this is where your trick would be useful?

    ReplyDelete
  2. Useless? I beg to differ! Using it to refresh the weather map on my desktop now. Thanks.

    ReplyDelete
  3. How about just pressing F5?

    ReplyDelete