WallRefresh-1.4

Window managers, icon programs, widgets, etc.
Message
Author
User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

WallRefresh-1.4

#1 Post by rhadon »

It's a small program to use a picture from the web as a wallpaper and it refreshes periodically.

You can use e.g. a satellite picture or one from a webcam.. Everytime you have a actual wallpaper.

The program uses gtkdialog4 and it works at least with Slacko 5.3.2.6, Racy 5.2.2.8, Wary 5.2, Lupu-528.004, Lazy Puppy and Akita beta7.

If you install gtkdialog4, it also works with Puppy 4.31, Lupu 525 and probably with others too.

It also works with Pwidgets now, but sometimes there's still a small problem with the background of the analog clock widget.

You start the program with menu->Desktp->WallpaperRefresh Configuration.

- Type in a URL or select one.

- Refresh time determines the time, when the program looks for a newer picture. If it's available, it will be downloaded and the wallpaper will be refreshed. If no newer one is available, nothing happens.

- I added a new entry which will be executed after each refresh. This can be useful if running applications are needing a separate refresh (e.g. wbar)

- "Save refreshes to Log" is good to find out, how often a new picture is available (and if something doesn't work right :wink: ).

- "Backup URL file" copies the URL file to URL.bkp.
If you update the program or you delete something by accident, just copy URL.bkp back to URL.

- "Start WallRefresh at boot" should be clear, also "Start WallRefresh now".

If you use Pwidgets, at every refresh a Message pops up, about Syncing.
If you want to suppress this messages, open /usr/sbin/fixwidgets and change

Code: Select all

/usr/local/pwidgets/box_splash &
to

Code: Select all

# /usr/local/pwidgets/box_splash &
in my version it is line #39.



No warranty, no money back :wink: ! You should make a copy of your save file before testing.

Have fun :D ,
Rolf

UPDATE WallRefresh 1.4:
- Internationalisation, by now only english and german
- Added stu90's suggestions.

UPDATE WallRefresh 1.3:
- automatic preview
- simple backup function
- changed input from minutes to seconds
- changed 'gtkdialog' to 'gtkdialog4'

UPDATE WallRefresh 1.2:
- an additional entry which will be executed after each refresh
- changed path from /root/ to /usr/local/
- pictures are now in a separate folder

UPDATE WallRefresh 1.1:
- set_bg rewritten (thanks to stu90)
- Pwidgets seems to work now (tested with Lupu-528 and Slacko 5.3.2.6) but it looks very 'sensitive' to me. If a window hides the widgets during refresh, the background of the clock widget will go wrong till next refresh. Also it takes a 'long' time. Not recommended with small refresh rates. I'm not sure about different versions of Pwidget.
- If you changed the wallpaper but there was no new one on the web, the refresh tooks the time till a new picture was on the web. This is solved now.
- I cleaned the code (e.g. Rwallpaper from 9927 B to 2784 B).

Important: If you select a picture which is not available, then the program crashes. In this case you need to select a 'normal' wallpaper first. E.g. right click any icon on the desktop, select 'Backdrop', select any picture and 'Stretch'.

UPDATE wallrefresh-1.0-01.pet:
Fixed "Break by closing with upper right cross"
Added message if gtkdialog4 is not available
Attachments
wallrefresh-1.4.pet
edited version, Wed Mar 21, 2012 5:41 pm forum time, possible problem with non UTF-8 solved.
(8.01 KiB) Downloaded 691 times
wallrefresh-1.3.pet
updated version, sorry.
(6.92 KiB) Downloaded 718 times
WallRefresh-1.3.png
(134.86 KiB) Downloaded 1505 times
Last edited by rhadon on Wed 21 Mar 2012, 21:44, edited 15 times in total.
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#2 Post by SFR »

Really nice tool!
Works fine with Lupu-528.004 also, I just had to change this line:

Code: Select all

 gtkdialog -p main > $HOME/wallrefresh/.wprefreshrc
to:

Code: Select all

 gtkdialog4 -p main > $HOME/wallrefresh/.wprefreshrc
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

#3 Post by rhadon »

I'm glad you like it, SFR,

and I really appreciate infos like your's.

It's my very first attempt with gtkdialog, so I wouldn't know.

Thanks,
Rolf
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#4 Post by SFR »

BTW, I also had to change this line:

Code: Select all

ln -s /root/wallrefresh/wallrefresh.sh /root/Startup/wallrefresh
to:

Code: Select all

ln -s /root/wallrefresh/wallrefresh /root/Startup/wallrefresh
because the symlink created in /root/Startup points to /root/wallrefresh/wallrefresh.sh
and there is wallrefresh (without .sh suffix)

I didn't plunge into the code too much (since I'm relatively new in GtkDialog (and BASH), too :wink: ), but after all everything seems to work great, so thanks very much! :D

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

#5 Post by rhadon »

Your right SFR,

I've uploaded the edited version. So stupid faults loves me :oops: :lol: .

Thanks
Rolf
Last edited by rhadon on Thu 08 Mar 2012, 13:04, edited 1 time in total.
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#6 Post by RSH »

rhadon wrote:I've uploaded the edited version.
May be you did edit the wrong file/line of "gtkdialog"?

Downloaded .pet doesn't work in LazY Puppy (lucid based). If i choose to start the program at boot up, a dead link is created in Startup (goes to /root/wallrefresh/wallrefresh.sh - does not exist. Existing file name is : wallrefresh (no .sh) :(

I did edit line 82 in wprefresh-config and changed gtkdialog to gtkdialog4 and the application runs. :)

If i do close the window the applications runs only every second time (at the other time it removes/creates 1/1 the dead link in /root/Startup). :shock:
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

#7 Post by rhadon »

Hi RSH,

I just downloaded myself to be sure. The edited version is OK (at least about the link). Maybe you used the first version and not the edited one?

About gtkdialog vs. gtkdialog4, I'm not sure how to solve this problem. In Racy, gtkdialog is a symbolic link to gtkdialog4. I'll take a look.

Thanks for testing and the info,
Rolf
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#8 Post by RSH »

In LazY Puppy (lucid) gtkdialog is a symbolic link to gtkdialog3 - that's why the pet does not work after download. Changing described line to gtkdialog4 lets the application run.

The symbolic link in /root/Startup has wrong target (the existing target has no .sh in the name).

I did change that inside the script where the link is created and after that, the link is available.

The issue on closing the window (upper right cross) continues after all changes i had made. After closing the window the file .wprefreshrc doesn't contain usable data!

Data is: EXIT=abort.

EDIT: Did right now download the file again and - nothing has changed. :shock:
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#9 Post by SFR »

RSH wrote:If i do close the window the applications runs only every second time [...]
RSH wrote:The issue on closing the window (upper right cross) continues after all changes i had made.
That happens to me also, but only when I close the window via x button.
Using No and OK buttons makes it running right.
RSH wrote:EDIT: Did right now download the file again and - nothing has changed. :shock:
The dead link problem is weird, rhadon has uploaded corrected version.
Did you download the previous version?
The problem might be the same names of the attachement.

I had similar problem downloading InstantUpdate-004 for Lucid (which was 002 really, and then Playdayz replaced it to 004, but the names were the same);
I had to clear cookies IIRC and download again.
http://www.murga-linux.com/puppy/viewto ... 457#593457

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#10 Post by RSH »

SFR wrote:Did you download the previous version?
The problem might be the same names of the attachement.
I did download the first one and did download the updated .pet two times. Second time i did download the updated .pet after my last post and then edited the post.

Line 82 in wprefrsh-config

Code: Select all

gtkdialog4 -p main > $HOME/wallrefresh/.wprefreshrc
writes content of gtkdialog4 data to $HOME/wallrefresh/.wprefreshrc. If closing the window using the right upper cross, gtkdialog contains EXIT=abort, which is not usable data for the Wallrefresh application - but you could use it for

Code: Select all

if [ "EXIT" = "abort" ]; then
 #do things or do not
fi
stuff ! :)

Solution could be probably something like that:

Code: Select all


gtkdia=$(gtkdialog4 -p main)

if [ "EXIT" = "abort" ]; then
 
 echo "do nothing"
 
 else
 
 echo $gtkdia > $HOME/wallrefresh/.wprefreshrc
 ...
 ...
 ...

fi
I did not check this yet, but it should work
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

#11 Post by rhadon »

The original Lupu-528 (without update) doesn't work because it doesn't have gtkdialog4. Need to update :oops: .

Maybe changing "gtkdiakog" to "gtkdialog4" will work in general? I'll test.

Yes, Closing via X breaks .wprefreshrc :oops: . I'll change it soon.

It makes sense what SFR writes about downloading. I've never had this problem (Opera), but it's the best explanation, I can think about.

Thanks,
Rolf

Edit: yes RSH, something like that should work. Thanks.
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#12 Post by RSH »

rhadon wrote:The original Lupu-528 (without update) doesn't work because it doesn't have gtkdialog4. Need to update.
The original Lupu-528 is out! Too many problems (especially at sound)

Lucid Puppy 528-004 does have gtkdialog4 installed in /usr/sbin. :!:

But gtkdialog is a symbolic link to gtkdialog3 in lucid. :?

Code: Select all

sh-4.1# /usr/sbin/gtkdialog4 --version
gtkdialog version 0.8.0 (C) 2003-2007 Laszlo Pere, 2011 Thunor
sh-4.1# 

Code: Select all

sh-4.1# /usr/sbin/gtkdialog --version
gtkdialog version 0.7.21 (C) 2004, 2005, 2006, 2007 by Laszlo Pere
sh-4.1#
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

#13 Post by rhadon »

UPDATE, see first post please.

Fixed "Break by closing with upper right cross" and added a message if gtkdialog4 is not available.

To prevent problems with downloading, I slightly changed the name of the pet :wink: .

Have fun,
Rolf
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.

User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

#14 Post by rhadon »

I just found out that WallRefresh doesn't work with Pwidgets :( .
I'm working on it :) .

Rolf
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.

User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

#15 Post by rhadon »

WallRefresh 1.1 is out, see 1st post please.

Changes:

- set_bg rewritten (thanks to stu90)

- Pwidgets seems to work now (tested with Lupu-528 and Slacko 5.3.2.6) but it looks very 'sensitive' to me. If a window hides the widgets during refresh, the background of the clock widget will go wrong till next refresh. Also it takes a 'long' time. Not recommended with small refresh rates. I'm not sure about different versions of Pwidget.

- If you changed the wallpaper but there was no new one on the web, the refresh tooks the time till a new picture was on the web. This is solved now.

- I cleaned the code (e.g. Rwallpaper from 9927 B to 2784 B).

Have fun
Rolf
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#16 Post by RSH »

Works fine in LazY Puppy now! :D

Any suggestions how to automatically refresh "wbar" after wallpaper has changed? :cry:

This would be very nice and useful! :D

Good work, so far. :D
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

Wallrefresh & Wbar-Refresh

#17 Post by RSH »

Hi, rhadon.

I have eamined the scripts of wbar and found a solution to get also wbar refreshed. :D

Please use this script for your wallrefresh-script.

Code: Select all

#!/bin/sh
#------------------------------------------------------------------------------
# refresh wbar desktop dock
# 2012-03-10 RSH (@ murga-forum)
#------------------------------------------------------------------------------
WBSTARTUP=$HOME/Startup/wstart
killall wbar 2&> /dev/null
if [ -e $WBSTARTUP ] ; then
	exec $HOME/Startup/wstart 2> /dev/null
fi
exit 0
Do not insert this into your script (killall wbar... will kill also wallrefresh). Make a script file and call it from inside wallrefresh - runs, doesn't kill wallrefresh and works while the last 11 minutes perfectly. :D
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

#18 Post by rhadon »

Thanks for feedback, RSH.

Well, telling you that it's a problem of wbar, isn't really helpful.

I installed it just now for the first time. Right klick on wbar refreshes the background, but that's not automatic. Also 'Reload' button from the GUI does it. Then I tried some options from command line, but get mostly an error about a missing font.

Please try wbar from commanline. If there is an option which works for you and refreshes the background, I could integrate a request in wallrefresh-config to be executed after every refresh.

Wbar looks very nice, but my first thought was, it's pity that there is no autohide function (or I've overseen it). I'll play a little bit more with it, maybe I can give you later a better answer.

~Rolf
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#19 Post by pemasu »

Wallrefresh works great and it has even finnish webcam url preconfigured :D
Only one humble notification. Would it be better to locate wallrefresh folder to the /usr/local.....where all the other Puppy apps are located. /root could be better to be place for different kind configuration stuff and personal stuff inside preconfigured folders.

User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

#20 Post by rhadon »

Thanks for your kind feedback pemasu,

when I created this program, my intention was to have all scripts together in one folder. At this time it wasn't important for me where this was.

I think you are right, /usr/local or /usr/local/apps seems to be a better place. I'll do it.

btw., next version will have an additional entry where you can run a script after each refresh (e.g. if another application like wbar needs a separate refresh).

Greetings to suomi,
Rolf

Edit: I'm unsure, what do you think is best? /usr/local, /usr/local/apps/, /usr/share/ ? Everywhere are applications. I can't see any system.
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.

Post Reply