![]() Registered Member ![]()
|
Hi
I wrote a PERL script that download a random image from an wallpaper website. I am planning to run the script periodically in the background and use that image as a wallpaper. How can I set the downloaded image as a wallpaper in KDE4 from my script? Eventually I can write another script that would call the perl script to download the image, and then set it as a wallpaper, if perl is a problem... I found that under KDE3 it used to be through dcop but it does not seem to work under KDE4: dcop kdesktop KBackgroundIface setWallpaper "/path/to/my/wallpaper.jpg" 1 More complicated: Could someone give me a hint on how I could integrate this as a KDE screensaver or KDE wallpaper plugin (i.e. from the wallpaper config menu I could choose to use my script instead of slideshow). |
![]() Administrator ![]()
|
I believe Ruby, Python, C++, and EcmaScript bindings are available for writing custom backgrounds. Integrating a perl script would be very difficult, and D-Bus bindings are not currently available.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Either from perl I call a system() like command to execute a shell command, or I write a shell script that is going to run the perl script to download the image and then call the appropriate command to set the wallpaper.
The bottom line is: Is there a command line to set the wallpaper in KDE4? What is it? |
![]() Administrator ![]()
|
Unfortunately, a command is not available due to the lack of a D-Bus interface... unless you want to do the following:
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Use 'plasma' instead of 'plasma-desktop'
and 'plasma-appletsrc' instead of 'plasma-desktop-appletsrc' Resarting plasma to change the wallpaper is a lousy solution. Plus editing plasma-appletsrc is not trivial (resizing?). No other solution (it's so easy to do in gnome and KDE3)? Hope the KDE4 team will come up with a CLI soon. |
![]() Administrator ![]()
|
As of KDE 4.3+ plasma-desktop is the correct executable and configuration file name.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Hi!
I use the KDE "slideshow" wallpaperer, drawing photos from my collections. I'm trying to do something much like the OP wants to do, but with a slight variation (simpler?). Under kde 3 I had a script that would edit .kde/share/config/kdesktoprc and change the list of directories from which to pull wallpaper pictures for KDE's slideshow. This was a two-step process: 1) Change KDE's list of directories from which to draw slideshow images: sed --in-place=.backup "s/^WallpaperList=.*\$/WallpaperList=$LIST/" $HOME/.kde/share/config/kdesktoprc 2) Tell KDE to reload the list and put up a new wallpaper: dcop kdesktop KBackgroundIface configure These commands obviously no longer work. It seems that kdesktoprc is no longer used, and that the new file is ~/.kde/share/config/plasma-desktop-appletsrc, and that the erstwhile effect of "WallpaperList" is now achieved by editing "slidepaths", right? But if I do edit that list: 1- How do I escape spaces, parens, etc., in filenames? 2- How do I list multiple directories? 3- How do I tell the slideshow to take note of the changed list? The first two should probably be trivial, but is the third possible under kde4? plasma-desktop doesn't list any promising-looking options (and restarting plasma just to change the wallpaper sounds wrong), plasmawallpaperviewer pops up a pretty image but I can't find documentation on it in /usr/man, /usr/share/doc, or google, and I don't know where else to go. Many thanks! -Ben |
![]() Administrator ![]()
|
I do not recommend editing the plasma-desktop-appletsrc file, since Plasma never re-reads the file while running, it only writes to it, so your changes will be lost on shutdown.
The correct method of implementing this would be through Plasma's Javascript interface, which is arriving in KDE SC 4.4.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
You could try using the scripted image wallpaper plugin: http://kde-look.org/content/show.php/Sc ... ent=115147
|
Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]