Photography
Switching desktop backgrounds in XFCE4
One of the things I liked about Gnome 2 was the ability to run a background 'slideshow' defined in an XML file with a list of background files to give me a change of scenery from time to time.
Switching to XFCE4 I can't seem to find a simple way to do that, but the ingredients are all there:
- I can set the background image to a list
- There's a handy-dandy xfdesktop command-line utility I can call to switch desktops
What's missing from the Desktop Settings is a setting for "switching background ever N minutes", which is kind of odd to not have, given the list thing being there - without my script it's only going to change every couple of weeks when I log in, or something. Not nearly often enough for me!
There's lots of stuff on the internet saying "Just run xfdesktop --reload in a cron job", but this does not work for me, since cron is running with a different environment, and so xfdesktop doesn't know where the X server is and doesn't have the necessary XAUTHORITY and DISPLAY settings.
If it was just DISPLAY that was needed it would be easy enough to set that in the crontab and be done with it - after all it doesn't change very often. XAUTHORITY is harder, since on Debian systems (and presumably others too) it has a random component in the name of a directory which lives in a directory without read permissions.
I solved it with this script, which steals those values from the environmnt of xfce4-panel, which will be running already:
#!/bin/sh
#
PANELPID="`/usr/bin/pgrep -U ${LOGNAME} xfce4-panel`"
stealEnvironment() {
tr '\000' '\012' < /proc/$PANELPID/environ | grep -a "^$1=" | cut -f2- -d=
}
export DISPLAY="`stealEnvironment DISPLAY`"
export XAUTHORITY="`stealEnvironment XAUTHORITY`"
/usr/bin/xfdesktop --reload
So now I have my background image switching among my favourite photos again, and my Desktop is effectively back as it was a week ago.
Changing an old habit
I'm a keen amateur photographer and have been since I was at school. Of course back then it involved smelly chemicals, strange lights and dark rooms. The expense and hassle of film eventually did it in for me and in 2000 I bought my first digital camera. After a series of increasingly sophisticated devices, back in 2007 I bought a Nikon D80 and soon thereafter I discovered that you can do things with raw camera files that have some analogies to the darkroom processing of my youth.
Recent comments
38 weeks 6 days ago
39 weeks 5 days ago
44 weeks 4 hours ago
1 year 12 weeks ago
1 year 13 weeks ago
1 year 21 weeks ago
1 year 26 weeks ago
1 year 26 weeks ago
1 year 27 weeks ago
1 year 27 weeks ago