Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 18 Apr 2014, 12:01
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
Easy to use random wallpaper changer
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 6 [83 Posts]   Goto page: 1, 2, 3, 4, 5, 6 Next
Author Message
rmcellig

Joined: 19 Nov 2011
Posts: 892
Location: Ottawa Ontario Canada

PostPosted: Mon 23 Apr 2012, 19:25    Post subject:  Easy to use random wallpaper changer  

So far this is all I found. Is there anything else that is very easy to use and setup for Puppy Linux? I have a friend of mine who is thinking of changing from Windows XP to Puppy Linux and she asked me if there was an easy wallpaper changer that she could use.

http://www.murga-linux.com/puppy/viewtopic.php?t=37561
Back to top
View user's profile Send private message Visit poster's website 
SFR


Joined: 26 Oct 2011
Posts: 879

PostPosted: Tue 24 Apr 2012, 18:11    Post subject:  

Could be something like this?
It's just a "one minute work", but so far it works quite well.

Code:
#!/bin/bash

# Randomly changes the wallpaper at fixed time intervals

INTERVAL=10      # in seconds

while true; do
  sleep $INTERVAL
  WALLPAPER=`ls /usr/share/backgrounds | sort -R | head -1`
  set_bg "/usr/share/backgrounds/$WALLPAPER"
done


Adjust the time interval to your needs, save the script as "randomwallpaper" to /root/Startup and make it executable.
Now click on it.
To stop the script, open terminal and type:
Code:
killall randomwallpaper

Hopefully, should work on Puppies with Nathan Wallpaper Setter (mine is Lupu-528.005).

Hope this helps.
Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
rmcellig

Joined: 19 Nov 2011
Posts: 892
Location: Ottawa Ontario Canada

PostPosted: Tue 24 Apr 2012, 18:20    Post subject:  

Thanks! Is there anything I need to do when I create a script? I have never created a script before but this looks pretty straightforward.
Back to top
View user's profile Send private message Visit poster's website 
SFR


Joined: 26 Oct 2011
Posts: 879

PostPosted: Tue 24 Apr 2012, 18:29    Post subject:  

rmcellig wrote:
Thanks! Is there anything I need to do when I create a script? I have never created a script before but this looks pretty straightforward.

Just copy the code into Geany, save it as randomwallpaper to /root/Startup, and then:
right-click -> File 'randomwallpaper' -> Properties and check all boxes under "Exec".
The script will start automatically at every boot.

Nothing more is required, I believe. Smile

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
rmcellig

Joined: 19 Nov 2011
Posts: 892
Location: Ottawa Ontario Canada

PostPosted: Tue 24 Apr 2012, 21:41    Post subject:  

Thanks!
Back to top
View user's profile Send private message Visit poster's website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Tue 24 Apr 2012, 23:33    Post subject:  

Now part of Puppy Hacker School code
http://puppylinux.org/wikka/PuppySchoolProgramming

Puppy Linux
Solutions for penguins

_________________
Puppy WIKI
Back to top
View user's profile Send private message Visit poster's website 
Jim1911

Joined: 19 May 2008
Posts: 2445
Location: Texas, USA

PostPosted: Sun 29 Apr 2012, 18:39    Post subject:    

Thank you SFR! Very Happy
Back to top
View user's profile Send private message 
mikeslr


Joined: 16 Jun 2008
Posts: 764
Location: Union New Jersey USA

PostPosted: Thu 03 May 2012, 15:19    Post subject: Thanks SFR & 2 comments  

Thanks SFR,

Just the little nicety I was looking for.

Just 2 comments:

(1) You code uses the background folder. If someone doesn't want to use all, or any of the backgrounds located there, a folder (for example, backgrounds1) can be created and the desired Wallpaper.jpgs placed there. In such case, the relevant portion of your code would read:

WALLPAPER=`ls /usr/share/backgrounds1 | sort -R | head -1`
set_bg "/usr/share/backgrounds1/$WALLPAPER"

(2) More importantly, the desired jpgs should first be resized to your monitor's settings. Apparently, if they are larger than your monitor's max, they are "centered" with only their central portions appearing: i.e, edges not displayed. Perhaps this description is not technically correct. It's just how it appears to me.

But anyway, a great addition to Puppies.

Thanks again,

mikesLr
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 879

PostPosted: Thu 03 May 2012, 18:33    Post subject:  

Thanks to all of you for appreciation. Smile

@mikeslr:

1. Good thinking.
2. Good point, I have had stretched wallpaper already set, before running the script, so didn't notice the fact.
Anyway, it's fixed now, thanks.

For those who are having wbar installed and don't want to reload it manually, a small addition - automatic reload every time wallpaper changes.

Code:
#!/bin/bash

# Randomly changes the wallpaper at fixed time intervals

INTERVAL=10            # in seconds
PIX_PATH=/usr/share/backgrounds      # path to wallpapers folder

# Wallpaper always stretched
echo "Stretch" > /root/.config/wallpaper/backgroundmode

while true; do
  sleep $INTERVAL
  WALLPAPER=`ls "$PIX_PATH" | sort -R | head -1`
  set_bg "$PIX_PATH/$WALLPAPER"

# Restart wbar, if already running
[ `pidof wbar` ] && killall wbar && wbar &

done

Note: there's a problem when reloading/refreshing wbar-2.2.2 - if there's a window over it during refresh, some junk will be "stamped" on wbar. Sad

But:

Some time ago I took wbar-2.2.2 from Saluki repo (due to nice icons) and replaced the main binaries with those from the latest wbar_2.3.0-1 and wbar-config_2.3.0-1 deb files (due to fixed 'bottom-right location' bug) and I just now realized that the above issue ("stamping") no longer exists (at least in Lupu)! Very Happy

If anyone's interested, I've attached the .pet.
Works out-of-the-box in latest Lucid.
In other pups libImlib2 most likely should be installed.

Greetings!
wbar-2.3.0-1_i386.pet
Description 
pet

 Download 
Filename  wbar-2.3.0-1_i386.pet 
Filesize  466.01 KB 
Downloaded  523 Time(s) 

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 879

PostPosted: Sat 05 May 2012, 12:38    Post subject: Random Wallpaper Changer  

Ok, I knew it was going to end up like that; I just couldn't resist to "GtkDialog'ize" it.

I tried to make this app as "foolproof" as possible, and hope it will work well for others too.

Works in latest Lupu + briefly tested in Slacko and Wary.

UPDATE 2012-05-06: v1.1 - few bugfixes
UPDATE 2012-05-06: v1.2 - better handling of special characters in filenames
________________________

EDIT: The lastest version (RWC-1.6.5) is attached >>>HERE<<<.

Greetings!
RWC-1.2.pet
Description  Random Wallpaper Changer v1.2
pet

 Download 
Filename  RWC-1.2.pet 
Filesize  2.51 KB 
Downloaded  546 Time(s) 
RWC_v1.0.png
 Description   
 Filesize   21.35 KB
 Viewed   2136 Time(s)

RWC_v1.0.png


_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.

Last edited by SFR on Tue 20 Nov 2012, 09:09; edited 10 times in total
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 879

PostPosted: Sun 06 May 2012, 07:58    Post subject:  

I have found a bug, which, in the long run, could result in decreasing free memory (due to growing /tmp/xerrs.log file),
especially when using RWC and Pwidgets together.
Fixed now. Attachment in the previous post has been updated.

Note: pictures with spaces in filenames won't be displayed.

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
Jim1911

Joined: 19 May 2008
Posts: 2445
Location: Texas, USA

PostPosted: Sun 06 May 2012, 08:54    Post subject:  

Thanks for the updates, however there is a minor problem running it on Slacko. Time is set for 1 minute, however, after a minute the wallpaper changes properly, followed by another change about 1 second later. So for some reason time alternates between minutes and seconds.

Changed time to 2 minutes, error was not present. Switched back to 1 minute, error did not repeat, so it's just one of those random occurrences. Embarassed
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 879

PostPosted: Sun 06 May 2012, 14:10    Post subject:  

Hey Jim, thanks for the feedback.
Has that problem occurred in v1.0?
I'm guessing that previous bug could cause such behaviour, but haven't encountered it when testing in Slacko...
Anyway, I'm glad it's fine now. Smile
If there's anything else causing any problems, feel free to let me know.

Ok, spaces in filenames are allowed now, the attachment above has been updated, again.
Phew, such a tiny app, and so many things to take care of - hope it's the last fix. Laughing

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
Jim1911

Joined: 19 May 2008
Posts: 2445
Location: Texas, USA

PostPosted: Sun 06 May 2012, 14:26    Post subject:  

SFR wrote:
Some time ago I took wbar-2.2.2 from Saluki repo (due to nice icons) and replaced the main binaries with those from the latest wbar_2.3.0-1 and wbar-config_2.3.0-1 deb files (due to fixed 'bottom-right location' bug) and I just now realized that the above issue ("stamping") no longer exists (at least in Lupu)! Very Happy

If anyone's interested, I've attached the .pet.
Works out-of-the-box in latest Lucid.
In other pups libImlib2 most likely should be installed.

Greetings!
Thank you, it's working great in Slacko. Very Happy
Back to top
View user's profile Send private message 
Jim1911

Joined: 19 May 2008
Posts: 2445
Location: Texas, USA

PostPosted: Sun 06 May 2012, 14:30    Post subject:  

SFR wrote:
Hey Jim, thanks for the feedback.
Has that problem occurred in v1.0?
I'm guessing that previous bug could cause such behaviour, but haven't encountered it when testing in Slacko...
Anyway, I'm glad it's fine now. Smile
If there's anything else causing any problems, feel free to let me know.

Ok, spaces in filenames are allowed now, the attachment above has been updated, again.
Phew, such a tiny app, and so many things to take care of - hope it's the last fix. Laughing

Greetings!
v. 1.1, I see that 1.2 is available now. It's hard to keep up with your updates. Very Happy
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 6 [83 Posts]   Goto page: 1, 2, 3, 4, 5, 6 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0758s ][ Queries: 13 (0.0045s) ][ GZIP on ]