How do I change the puppy desktop background

Booting, installing, newbie
Post Reply
Message
Author
User avatar
willhunt
Posts: 495
Joined: Wed 05 Oct 2005, 18:19

How do I change the puppy desktop background

#1 Post by willhunt »

a customer asked me today after I conviced him to use puppy that he loved it but had a utility in windows that changed his desktop background every x minutes and was wondering if this was possible in linux! I told them I was sure there was but had no idea how one would go about it! so I was hoping someone might have a idea as how to accopmlish this?

btw: the util he used was called webshots

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#2 Post by HairyWill »

Here is a sample script that will achieve your purpose in puppy.

Code: Select all

#!/bin/sh
cd /root/my-pictures
counter=0
if [ $# -ne 1 ]
then
	pause=300
else
	pause=$1
fi
while true
do
for pic in *.jpg
do
	echo counter=$counter
	puppybackgroundsetter -stretch $pic blue
	/usr/local/Puppybackground/resource/roxrestart.sh
	sleep $pause
counter=`expr $counter + 1`
echo
done
done
If called with no arguments it will change the background every 5 minutes cycling through all the jpg files in my-pictures. You can specfy one argument, the number of seconds between picture changes. There is a bug in the underlying background setter call that means after 255 changes no more changes will happen untill the X server is restarted, MU is aware of this, though you still get a change every 5 minutes for up to 21 hours so its not a major problem.

To use this yourself use the rox filer to go to /root/my-applications/bin
right click on the background and do New - Script.
Call it whatever you like.
right click on the new file and do Open as Text
Paste in the script contents above and save
Now click on the script in Rox
or call it by name on the command line with or without your optional argument
If you want you can drag the file onto your desktop to create a shortcut
This will also allow you to right click on the shortcut and set the argument for timing.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
bostonvaulter
Posts: 269
Joined: Wed 27 Sep 2006, 03:41

#3 Post by bostonvaulter »

darn, i was all setup to try this. Then I realized that I was running xfce and it wouldn't work... Is there an easy way to modify it for xfce?

Thanks,
Jason
[img]http://img.photobucket.com/albums/v212/BostonVaulter/avatar/puppybar.png[/img]

User avatar
willhunt
Posts: 495
Joined: Wed 05 Oct 2005, 18:19

Just right

#4 Post by willhunt »

thanks for the script works just great!!! just one question how do I stop it at 254?
and just for fun here's a gui to go with everything it points to /usr/share/backgrounds
and faults to 10 min just in case :wink: please let me know how it works for you
Attachments
BGC.tar.gz
desktop background slideshow thingie
(3.3 KiB) Downloaded 199 times

User avatar
trapster
Posts: 2117
Joined: Mon 28 Nov 2005, 23:14
Location: Maine, USA
Contact:

#5 Post by trapster »

darn, i was all setup to try this. Then I realized that I was running xfce and it wouldn't work... Is there an easy way to modify it for xfce?
I haven't tried this but 'xfdesktop -reload' might do the trick??
DESCRIPTION
xfdesktop manages the desktop itself in the Xfce 4 Desktop Environment. This includes drawing the desktop backdrop and providing a right-click applications menu and middle-click window list menu. Only one instance of xfdesktop can be running at a time, and should be started by running xfdesktop without any arguments.

OPTIONS

-reload
Causes an already-running instance of xfdesktop to reload all its settings, including loading a new random backdrop if using a backdrop list.
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#6 Post by Pizzasgood »

Replace the

Code: Select all

done
done
with this:

Code: Select all

if [ $counter = 254 ]; then
break
fi
done
if [ $counter = 254 ]; then
break
fi
done
That should make it stop after the 254'th cycle. Is that necessary though? Or does it actually crash on the 255'th round?
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#7 Post by MU »

Concerning the reported bug with more than 254 pictures:
I had a look at puppybackgroundsetter.c, which is in source.tgz in the backgroundsetter dotpup:
http://puppyfiles.org/dotpupsde/dotpups ... roundmenu/
I thought I might have forgotten to close the X connection to the display after setting the picture.
But the required code is there:

Code: Select all

XSync(disp,0);
  XFlush(disp);
  XCloseDisplay(disp);
  return 0;

}
I actually have no idea, what else could cause this problem.
Mark

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#8 Post by MU »

http://puppyfiles.org/dotpupsde/dotpups ... 7.0.tar.gz

That is the old console-backgroundsetter from Puppy 1.

Or:
http://puppyfiles.org/dotpupsde/dotpups ... msetbg.pup

This is the one from the WindowMaker windowmanager.

Type
xli --help
or
wmsetbg --help

for infos about the usage.
With one of those, the unsolved bug of my program might not appear.

Mark

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#9 Post by HairyWill »

Actually this is a problem because once the 255 limit is reached it is not possible to open any more windows.

The error given from the script is

Code: Select all

Xlib: connection to ":0.0" refused by server
Xlib: Maximum number of clients reached
Can't open display :0.0
If puppybackgroundsetter is not the cause then maybe it is roxrestart.sh which calls setrox2backdrop which contains

Code: Select all

#!/bin/sh
 #requires $1=path-to/image-name
 #and it must be already stretched to fill the screen.
  
rox --RPC << EOF
<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope">
<env:Body xmlns="http://rox.sourceforge.net/SOAP/ROX-Filer">
<SetBackdrop>
<Filename>$1</Filename>
<Style>Stretch</Style>
</SetBackdrop>
</env:Body>
</env:Envelope>
EOF
Surely the problem isn't in rox itself??
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
willhunt
Posts: 495
Joined: Wed 05 Oct 2005, 18:19

not that I would have a clue about......

#10 Post by willhunt »

Ive not set the delay short enough to find out but I do know that when I go into some dir where I have over a 1000 files rox crashes and I lose my pinboard

User avatar
willhunt
Posts: 495
Joined: Wed 05 Oct 2005, 18:19

XFCE

#11 Post by willhunt »

I found a howto for your xfce but I would still like to add it to Harry's script but I'm not shure how
the howto says you need to create a list of images like this

Right-click on your desktop.
Select Desktop settings.
Make sure that the Allow Xfce to manage the desktop and Show Image boxes are
checked (that is the default).
Click then on New list.
Add the image files by clicking on the +
Once you are done, save the list. You are now back in the previous screen and your
new list should be selected in the File input box. Then close that interface.

I added some stuff to the script but not know if it will work for you as I am very new to this cripting thing

Code: Select all

#!/bin/sh

cd /usr/share/backgrounds
#code for xfce here
CURRENTWM="`cat /etc/windowmanager`"
counter=0 
if [ $# -ne 1 ] 
then 
#pause=1tik=1sec
   pause=1
else 
   pause=$1 
fi 
while true 
do 
for pic in *.jpg 
do 
   echo counter=$counter 
#maybe put something like this for your xfce
if [ "$CURRENTWM" = "xfce" ];then
#echo /usr/share/backgrounds/$pic >/path/to/piclist.txt
killall -USR1 xfdesktop
else
   puppybackgroundsetter -stretch $pic blue 
   /usr/local/Puppybackground/resource/roxrestart.sh 
   sleep $pause 
counter=`expr $counter + 1` 
echo 
donif [ $counter = 254 ]; then 
break 
fi 
done 
if [ $counter = 254 ]; then 
break 
fi 
done
and the sliderbar thingie is

Code: Select all

#!/bin/sh
DELAY=`Xdialog 2>&1 --title "Set Background Delay" --rangebox "60 = 1min" 9 50 0 600 10`

case $? in
  0)
    bgc "$DELAY";;
  1)
    echo "Cancel pressed.";;
  255)
    echo "Box closed.";;
esac
Last edited by willhunt on Thu 12 Apr 2007, 17:04, edited 1 time in total.

User avatar
bostonvaulter
Posts: 269
Joined: Wed 27 Sep 2006, 03:41

#12 Post by bostonvaulter »

Thanks everybody,

so far I have only tried using xfdesktop -reload but it is working good. The only thing is that it appears to be random rather than going in order.

but looking at the backdrops.list file it seems like I could just write a script to over write the contents of the file with the image that I want. It's a really simple file just a list of the paths to the different files.

Jason
[img]http://img.photobucket.com/albums/v212/BostonVaulter/avatar/puppybar.png[/img]

Post Reply