Changing the backdrop

Steven Robson s.a.robson at sms.ed.ac.uk
Tue Nov 8 21:30:04 CET 2005


On Tuesday 08 November 2005 20:53, Iain Scurrah wrote:
>
> The only problem is that it never ends. After Exiting Xfce and re-logging
> in, either as myself, or as my wife, the script keeps running. I would have
> two copies of this script running, my wife has one (and she uses KDE
> (although she wouldn't be able to tell you that)).
>
> Is there anyway I can get Xfce to kill this script on exiting Xfce? Maybe I
> could use the session manager to start the (or similar) script when I
> login, but it would need to kill it on logout...
>
> A test that Xfce is running in the while loop would (probably) not be good
> enough because if I log back into Xfce a second time, the script will
> contine, and if my wife logs into KDE, then the xfdesktop is likely to be
> reloaded (and the worst thing about this is that it changes her screen
> resolution).

Iain,

I'm not entirely certain of the reasons behind it, but the script needs to 
catch SIGHUP in order to exit. I use the following script to change the 
background (very similar to yours, in fact):

#!/bin/bash

handle_hup ()
{
  exit 0
}

trap "handle_hup" HUP

while(true)
do
sleep 20m
xfdesktop -reload
done


Hope this helps,

StevenR


-- 
Somebody's terminal is dropping bits.  I found a pile of them over in the
corner.



More information about the Xfce mailing list