Re: [FC1] Changing screen background from script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Laurence Orchard wrote:
> Hi All
> 
> I have a series of digital photos taken with my camera using a time
> delay of 1 min over two hours.
> 
> I would like to use these as a changing screen background on a 2 hour
> loop.
> I know how to change the background using the menu system, but I think I
> need to use a script to do what I want.

Under GNOME, try putting something like this in your (user) crontab:

#!/bin/bash
# rotate the backdrop in X

PIC_DIR=/mnt/data/Pictures/Backdrop

cd $PIC_DIR || exit
CHOICE=$(expr $RANDOM \* $(ls 2>/dev/null | wc -l )  / 32768 + 1)
PICTURE=$(ls 2>/dev/null | tail -n $CHOICE | head -1)

nice -20 gconftool-2 --type=string \
    --set /desktop/gnome/background/picture_filename "$PIC_DIR/$PICTURE"

Note: that \ on the penultimate line must be right at the end of the
line (no further spaces or tabs). Obviously, you replace PIC_DIR's
value with where you keep your pictures.

HTH,

James.

-- 
E-mail address: james@ | "OPENING LINES OF THE 23RD PSALM
westexe.demon.co.uk    | Original version:
                       | The Lord is my Shepherd, I'll not want."
                       |     -- "The Independent" thinks David spoke English



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux