Hi, I want to change my wallpaper lets say every 30 or 5 minutes. I will prepare a script, which will replace the current picture with a new one, without changing the name, so there will be no need to mess with the desktop options. And I will set this script to be run from cron. My only problem is, that I do not know hot to invoke desktop refresh, so the new picture to be displayed. I need to refresh all kde user sessions, if more than one. Any clue? Thanks Sunny -- Get Firefox http://www.spreadfirefox.com/?q=affiliates&id=10745&t=85
Hi Sunny, check "xscreensave" whether it matches your needs/ideas. This says it is just a matter of changing a config file ... which might already be what you want. Otherwise there are the programs xdmbgrd and xbanner which might be of your choice too. Just look into the documentation, since I am sure there is already a solution for your idea. Good luck Martin Sunny wrote:
Hi,
I want to change my wallpaper lets say every 30 or 5 minutes. I will prepare a script, which will replace the current picture with a new one, without changing the name, so there will be no need to mess with the desktop options. And I will set this script to be run from cron.
My only problem is, that I do not know hot to invoke desktop refresh, so the new picture to be displayed. I need to refresh all kde user sessions, if more than one. Any clue?
Thanks Sunny
Hi. El Martes, 14 de Diciembre de 2004 22:24, Sunny escribió:
Hi,
I want to change my wallpaper lets say every 30 or 5 minutes. I will prepare a script, which will replace the current picture with a new one, without changing the name, so there will be no need to mess with the desktop options. And I will set this script to be run from cron.
My only problem is, that I do not know hot to invoke desktop refresh, so the new picture to be displayed. I need to refresh all kde user sessions, if more than one. Any clue?
this is a standar funcionality of the kde. take a look at Control centre, background. you can see a presentation option, you can select a number of images to display as background and set the time between changes.
Thanks Sunny
- Get Firefox http://www.spreadfirefox.com/?q=affiliates&id=10745&t=85
-- Un Saludo. Carlos Lorenzo Matés
On Tue, 14 Dec 2004 22:57:19 +0100, Carlos Lorenzo Matés
Hi.
El Martes, 14 de Diciembre de 2004 22:24, Sunny escribió:
Hi,
I want to change my wallpaper lets say every 30 or 5 minutes. I will prepare a script, which will replace the current picture with a new one, without changing the name, so there will be no need to mess with the desktop options. And I will set this script to be run from cron.
My only problem is, that I do not know hot to invoke desktop refresh, so the new picture to be displayed. I need to refresh all kde user sessions, if more than one. Any clue?
this is a standar funcionality of the kde.
take a look at Control centre, background. you can see a presentation option, you can select a number of images to display as background and set the time between changes.
Thanks Sunny
- Get Firefox http://www.spreadfirefox.com/?q=affiliates&id=10745&t=85
--
Un Saludo.
Carlos Lorenzo Matés
Thanks Carlos, I'll take a look there. Presentation is not exactly what I need, as the image will be generated just before displaying. As I ssh to the machine in question, all my thoughts were about something with CLI :). I checked KDE docs, but I didn't see that option, and went in the wrong direction :) Ok, later when I'm there, I'll take more deep look. Cheers Sunny -- Get Firefox http://www.spreadfirefox.com/?q=affiliates&id=10745&t=85
Sunny, On Tuesday 14 December 2004 13:24, Sunny wrote:
Hi,
I want to change my wallpaper lets say every 30 or 5 minutes. I will prepare a script, which will replace the current picture with a new one, without changing the name, so there will be no need to mess with the desktop options. And I will set this script to be run from cron.
My only problem is, that I do not know hot to invoke desktop refresh, so the new picture to be displayed. I need to refresh all kde user sessions, if more than one. Any clue?
That's not really a cron kind of thing. What you want is already built in to the KDE desktop software. I configure my desktop to display a photographic image of the Earth with an up-to-date terminator (with a nighttime iamge that displays urban light islands on the dark side of the planet) using the existing features of the background image support in KDE and the XPlanet software to synthesize the image. To wit: - Control Center -> Appearance & Themes -> Background - Click "Advanced Options" - Enable "Use the following program for drawing the background" Create a new entry that will invoke the script that generates you background image. Set the "Refresh time" to suit your taste. Look at an existing entry for clues on how to configure a background generator. The most important thing to know is that the name of the file in which to place new background images is expanded in place of any occurrences of "%f" in the command strings. Note, too, that this name will have no particular image-type-specific suffix (such as ".jpg", e.g.). If the program you use to generate an image requires such a suffix so it can determine what kind of image format to produce, you'll have to do something like this: Command: image-generator %f.png && mv %f.png %f
Thanks Sunny
Randall Schulz
On Tue, 14 Dec 2004 13:57:42 -0800, Randall R Schulz
Sunny,
On Tuesday 14 December 2004 13:24, Sunny wrote:
Hi,
I want to change my wallpaper lets say every 30 or 5 minutes. I will prepare a script, which will replace the current picture with a new one, without changing the name, so there will be no need to mess with the desktop options. And I will set this script to be run from cron.
My only problem is, that I do not know hot to invoke desktop refresh, so the new picture to be displayed. I need to refresh all kde user sessions, if more than one. Any clue?
That's not really a cron kind of thing.
What you want is already built in to the KDE desktop software.
I configure my desktop to display a photographic image of the Earth with an up-to-date terminator (with a nighttime iamge that displays urban light islands on the dark side of the planet) using the existing features of the background image support in KDE and the XPlanet software to synthesize the image.
To wit:
- Control Center -> Appearance & Themes -> Background - Click "Advanced Options" - Enable "Use the following program for drawing the background"
Create a new entry that will invoke the script that generates you background image. Set the "Refresh time" to suit your taste. Look at an existing entry for clues on how to configure a background generator. The most important thing to know is that the name of the file in which to place new background images is expanded in place of any occurrences of "%f" in the command strings. Note, too, that this name will have no particular image-type-specific suffix (such as ".jpg", e.g.). If the program you use to generate an image requires such a suffix so it can determine what kind of image format to produce, you'll have to do something like this:
Command: image-generator %f.png && mv %f.png %f
Thanks Sunny
Randall Schulz
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
Thanks Randal, I have always wondered why "reinventing the wheel" approach always hits me :) -- Get Firefox http://www.spreadfirefox.com/?q=affiliates&id=10745&t=85
On Tue, 14 Dec 2004 13:57:42 -0800, Randall R Schulz
That's not really a cron kind of thing.
What you want is already built in to the KDE desktop software.
I configure my desktop to display a photographic image of the Earth with an up-to-date terminator (with a nighttime iamge that displays urban light islands on the dark side of the planet) using the existing features of the background image support in KDE and the XPlanet software to synthesize the image.
To wit:
- Control Center -> Appearance & Themes -> Background - Click "Advanced Options" - Enable "Use the following program for drawing the background"
Create a new entry that will invoke the script that generates you background image. Set the "Refresh time" to suit your taste. Look at an existing entry for clues on how to configure a background generator. The most important thing to know is that the name of the file in which to place new background images is expanded in place of any occurrences of "%f" in the command strings. Note, too, that this name will have no particular image-type-specific suffix (such as ".jpg", e.g.). If the program you use to generate an image requires such a suffix so it can determine what kind of image format to produce, you'll have to do something like this:
Command: image-generator %f.png && mv %f.png %f
Randall Schulz
Ok, I created this script: <code> #!/bin/bash FILENAME=$1 wget --proxy=off http://somewhere.com/GetRandomImage -O "$FILENAME" date >> /home/sunny/tmp/refresh echo "$FILENAME" >> /home/sunny/tmp/refresh </code> the last 2 lines are only for some logging to see what happens. Now, if I invoke this with: get_pic test.jpg it works like a charm, and it creates test.jpg, and logs in the file refresh. So, next step was to go to Enable "Use the following program for drawing the background", and there I have changed kwebdesktop with: /path/to/get_pic %f Also, I set the refresh rate to 5 minutes (this is the minimum), and sit waiting ... :) And ... nothing changes. No log entries as well. My script is never invoked. So, I guess I miss something. Any clue? Thanks Sunny -- Get Firefox http://www.spreadfirefox.com/?q=affiliates&id=10745&t=85
Sunny, On Wednesday 15 December 2004 17:13, Sunny wrote:
On Tue, 14 Dec 2004 13:57:42 -0800, Randall R Schulz wrote:
That's not really a cron kind of thing.
What you want is already built in to the KDE desktop software.
...
Randall Schulz
Ok, I created this script: <code> #!/bin/bash FILENAME=$1 wget --proxy=off http://somewhere.com/GetRandomImage -O "$FILENAME" date >> /home/sunny/tmp/refresh echo "$FILENAME" >> /home/sunny/tmp/refresh </code>
the last 2 lines are only for some logging to see what happens.
Now, if I invoke this with: get_pic test.jpg it works like a charm, and it creates test.jpg, and logs in the file refresh.
Does that script work properly even if the argument has no suffix? I guess that since it retrieve an image from the Web and stores the result via wget's -O option, it should be fine. (That's really what it does, right? That's not just a sample you're using for illustration here, is it?) Is the background-generating script in the default PATH you have at login time?
So, next step was to go to Enable "Use the following program for drawing the background", and there I have changed kwebdesktop with: /path/to/get_pic %f
Also, I set the refresh rate to 5 minutes (this is the minimum), and sit waiting ... :)
And ... nothing changes. No log entries as well. My script is never invoked.
So, I guess I miss something. Any clue?
I trust you enabled the "Use the following program for drawing the background", since without it the other relevant controls are disabled. Did you select your entry from the list of background-generating programs? Lastly, be sure in the main "Background" panel that you select "No picture" in the "Background" section.
Thanks Sunny
By the way, is there a source of image files on the Web that are good candidates for this sort of use? Lastly, if anyone knows how I can get current composite satellite images, including cloud and ground cover instead of the fixed image generated by XPlanet, please let me know. I want to watch when the tornadoes hit Ohio next summer. Randall Schulz
On Wed, 15 Dec 2004 17:28:04 -0800, Randall R Schulz
Sunny,
On Wednesday 15 December 2004 17:13, Sunny wrote:
On Tue, 14 Dec 2004 13:57:42 -0800, Randall R Schulz wrote:
That's not really a cron kind of thing.
What you want is already built in to the KDE desktop software.
...
Randall Schulz
Ok, I created this script: <code> #!/bin/bash FILENAME=$1 wget --proxy=off http://somewhere.com/GetRandomImage -O "$FILENAME" date >> /home/sunny/tmp/refresh echo "$FILENAME" >> /home/sunny/tmp/refresh </code>
the last 2 lines are only for some logging to see what happens.
Now, if I invoke this with: get_pic test.jpg it works like a charm, and it creates test.jpg, and logs in the file refresh.
Does that script work properly even if the argument has no suffix? I guess that since it retrieve an image from the Web and stores the result via wget's -O option, it should be fine. (That's really what it does, right? That's not just a sample you're using for illustration here, is it?)
Thats correct, -O option is the output file, so it will write in whatever is put here, even with no extension. The url returns a picture (jpg), there is just one random generator script. The test case I showed to demonstrate that the script is ok is real.
Is the background-generating script in the default PATH you have at login time?
No, it is not, but I put the whole path in the text boxes, as I showed there:
So, next step was to go to Enable "Use the following program for drawing the background", and there I have changed kwebdesktop with: /path/to/get_pic %f
Also, I set the refresh rate to 5 minutes (this is the minimum), and sit waiting ... :)
And ... nothing changes. No log entries as well. My script is never invoked.
So, I guess I miss something. Any clue?
I trust you enabled the "Use the following program for drawing the background", since without it the other relevant controls are disabled.
There is no way to add/edit the existing entries without enabling.
Did you select your entry from the list of background-generating programs?
I didn't add new entry. I edited the existing kwebdesktop, replacing the three command fields with my script (with full path to it) and only option %f. And the last one is without options as it was.
Lastly, be sure in the main "Background" panel that you select "No picture" in the "Background" section.
Thats what I did.
By the way, is there a source of image files on the Web that are good candidates for this sort of use?
I do not know of any. This is a friends server, on which all my friends share pictures. I asked the friend to prepare this url to generate a random pic from all albums. I just wanted to be able to see my friends :)
Randall Schulz
Cheers Sunny -- Get Firefox http://www.spreadfirefox.com/?q=affiliates&id=10745&t=85
Sunny, On Wednesday 15 December 2004 17:56, Sunny wrote:
On Wed, 15 Dec 2004 17:28:04 -0800, Randall R Schulz wrote:
Sunny,
...
You showed this as your script:
<code> #!/bin/bash FILENAME=$1 wget --proxy=off http://somewhere.com/GetRandomImage -O "$FILENAME" date >> /home/sunny/tmp/refresh echo "$FILENAME" >> /home/sunny/tmp/refresh </code>
Although on my system the %f value has no spaces in it, I would not write a script that assumed that fact. I'd use this: ... FILENAME="$1" ...
Does that script work properly even if the argument has no suffix? I guess that since it retrieve an image from the Web and stores the result via wget's -O option, it should be fine. (That's really what it does, right? That's not just a sample you're using for illustration here, is it?)
Thats correct, -O option is the output file, so it will write in whatever is put here, even with no extension. The url returns a picture (jpg), there is just one random generator script.
The test case I showed to demonstrate that the script is ok is real.
Is the background-generating script in the default PATH you have at login time?
No, it is not, but I put the whole path in the text boxes, as I showed
Not necessarily. As I mentioned, the %f values generated by KDE do not include any suffix, be it ".png", ".jpg", ".gif" or anything else. Also, as I mentioned above, if for some reason (*) the %f value included spaces or shell meta-characters, your script would malfunction. (*) Might you have a space in your user name? there: Right.
...
I trust you enabled the "Use the following program for drawing the background", since without it the other relevant controls are disabled.
There is no way to add/edit the existing entries without enabling.
Exactly.
Did you select your entry from the list of background-generating programs?
Nonetheless, the desired entry from the list of background-generating commands must be selected.
I didn't add new entry. I edited the existing kwebdesktop, replacing the three command fields with my script (with full path to it) and only option %f. And the last one is without options as it was.
Does the preview work? Since you're not seeing any log entries, it's pretty clear your script isn't getting invoked. You should verify the setting of your command entry. In particular, make sure the path name is correct. Note, too, that you must have the command file name (accessible via PATH or an absolute path name) in the "Command:" and "Preview:" fields. Why there's an "Executable:" field, I don't know, since it appears to be completely redundant, to me.
Lastly, be sure in the main "Background" panel that you select "No picture" in the "Background" section.
Thats what I did.
...
Cheers Sunny
Randall Schulz
On Wed, 15 Dec 2004 18:42:59 -0800, Randall R Schulz
Although on my system the %f value has no spaces in it, I would not write a script that assumed that fact. I'd use this:
... FILENAME="$1" ...
On mine as well, but just changing this made the thing working :)
Randall Schulz
Thanks very much for the help. Now, there is only one additional problem with all this. It tiles the picture all over the place. I have no access to display options to tell it not to tile. I want the picture to be in its original size in the middle of the screen. Do you have some info about it? Cheers Sunny -- Get Firefox http://www.spreadfirefox.com/?q=affiliates&id=10745&t=85
Sunny, On Wednesday 15 December 2004 19:00, Sunny wrote:
On Wed, 15 Dec 2004 18:42:59 -0800, Randall R Schulz
wrote: Although on my system the %f value has no spaces in it, I would not write a script that assumed that fact. I'd use this:
... FILENAME="$1" ...
On mine as well, but just changing this made the thing working :)
Randall Schulz
Thanks very much for the help.
Wow. That's kind of odd, eh?
Now, there is only one additional problem with all this. It tiles the picture all over the place. I have no access to display options to tell it not to tile. I want the picture to be in its original size in the middle of the screen. Do you have some info about it?
Here's what I'd try: - Disable "Use the following program for drawing the background" in the "Advanced Options..." dialog - Select "Picture" in the "Background" section; Now the "Options" section will activate - from the "Position:" pop-up in the Options section select "Scaled", "Centered" or "Centered Auto Fit" (as your taste and best results dictate) - Now in the "Background" section, select "No picture" again - Re-enable "Use the following program for drawing the background" in the "Advanced Options..." dialog I don't really know if this will work or not, but it's worth a shot. I have XPlanet generate images at screen resolution, and while it presumably is not relevant for that reason, I use the "Scaled" option.
Cheers Sunny
Randall Schulz
On Wednesday 15 December 2004 21:29, Randall R Schulz wrote:
Here's what I'd try:
- Disable "Use the following program for drawing the background" in the "Advanced Options..." dialog - Select "Picture" in the "Background" section; Now the "Options" section will activate - from the "Position:" pop-up in the Options section select "Scaled", "Centered" or "Centered Auto Fit" (as your taste and best results dictate) - Now in the "Background" section, select "No picture" again - Re-enable "Use the following program for drawing the background" in the "Advanced Options..." dialog
I don't really know if this will work or not, but it's worth a shot.
I have XPlanet generate images at screen resolution, and while it presumably is not relevant for that reason, I use the "Scaled" option.
Randall Schulz
Yes, I tried it meanwhile. Also, I tried to change the setting in desktoprc file in my .kde directory. No luck. So, maybe it is a limitation. I can only think of some CLI image processing tool, so I can either resize the picture (not a good idea, it will be awful), or generate a new picture with this one in the middle, and surrounded with someneutral color. Thanks again for your time. Sunny -- Get Firefox http://www.spreadfirefox.com/?q=affiliates&id=10745&t=85
Sunny, On Wednesday 15 December 2004 19:57, Sunny wrote:
...
Yes, I tried it meanwhile. Also, I tried to change the setting in desktoprc file in my .kde directory. No luck. So, maybe it is a limitation.
I can only think of some CLI image processing tool, so I can either resize the picture (not a good idea, it will be awful), or generate a new picture with this one in the middle, and surrounded with someneutral color.
ImageMagick -- http://www.imagemagick.org/. It's exactly what you say: A command-line-driven image manipulation program. It's available on the SuSE installation media, at least it is in SuSE Pro 9.1.
Thanks again for your time.
No problemo!
Sunny
Randall Schulz
On Wednesday 15 December 2004 22:02, Randall R Schulz wrote:
ImageMagick -- http://www.imagemagick.org/. It's exactly what you say: A command-line-driven image manipulation program. It's available on the SuSE installation media, at least it is in SuSE Pro 9.1.
Randall Schulz
So, I achieved what I was trying to do. This was the task: 1. Get a picture from a known url 2. Set the desktop background to this picture. 3. Repeat this every xx minutes. Problems: 1. How to schedule the new retrieval 2. How to force KDE to refresh the background with the new picture. With the great help of Randall Schulz, here is what happened: I created a bash script like this: #!/bin/bash ###get the params #the filename of the dest. picture. It is provided by KDE (%f) FILENAME="$1" #the width of the screen - provided by KDE (%x) WIDTH="$2" #the HEIGHT of the screen - provided by KDE (%y) HEIGHT="$3" ### set the temp image filename for the background BACK=/tmp/desktop_back.jpg ### retreive and store in the file provided wget --proxy=off http://www.someurl.com/random/ \ -O "$FILENAME" ### theseprograms convert and composite are part ### of ImageMagik ### create the background with the given size convert -size "$WIDTH"x"$HEIGHT" xc:#1493EE "$BACK" ### put our picture in the middle and save in the same file composite -gravity center "$FILENAME" "$BACK" "$FILENAME" ### end of file Now, I right-clicked on the desktop and selected Configure desktop. On the background tab I selected "No picture". In the advanced settings, I selected "Use external program ..." Clicked ADD. And entered this info in the command and preview fields: /path/to/myscript %f %x %y And in the "executable" filed, only /path/to/myscript without the params. OK, OK, OK and I was set. Now, why I used ImageMagic - because there is no way to instruct KDE when using an external program for the desktop, to use some other display method that Tile. And when your picture is smaller it is tiled all over the place :) Of course this script is far away from perfect, as there are no error checks, etc. It even does not check if the downloaded image is bigger from the screen resolution. It may check this, and resize if needed. Cheers Sunny -- Get Firefox http://www.spreadfirefox.com/?q=affiliates&id=10745&t=85
* Sunny
On Wednesday 15 December 2004 22:02, Randall R Schulz wrote:
ImageMagick -- http://www.imagemagick.org/. It's exactly what you say: A command-line-driven image manipulation program. It's available on the SuSE installation media, at least it is in SuSE Pro 9.1.
Randall Schulz
So, I achieved what I was trying to do. This was the task:
1. Get a picture from a known url 2. Set the desktop background to this picture. 3. Repeat this every xx minutes.
Problems: 1. How to schedule the new retrieval 2. How to force KDE to refresh the background with the new picture.
<snip for brevity> This is a very fine example of the intended use of a support mail list. Thankyou Sunny -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/photos
participants (5)
-
Carlos Lorenzo Matés
-
Martin Deppe
-
Patrick Shanahan
-
Randall R Schulz
-
Sunny