Tuesday, February 24, 2009

Change Wallpaper in KDE

As I've mentioned, KDE comes with a nice, easy-to-set-up automatic wallpaper changer. Unfortunately, unlike with GNOME's wallpaper-tray, there's no way to change to the next random wallpaper -- you have to wait until the timer changes it, or turn off the automatic wallpaper changer and pick a different wallpaper.

I found a way to put an icon on my panel that I can click on to get a different, random wallpaper onto the desktop.

The approach is similar to the steps discussed in my earlier blog entry about my KDE MiniMenu.

Right-click on the KMenu icon and open the KDE Menu Editor. Add a new item. I gave my new item the name "NextWallpaper" and found an icon for it. In the command field, I used the following command:

dcop kdesktop KBackgroundIface changeWallpaper

I saved the new configuration, then added this new item to my desktop's panel (right-click on the panel > Panel Menu > Add Application to Panel > NextWallpaper).

Here are a few related commands that you can run from a terminal:

If you want to know the filename for the wallpaper that's currently showing on your desktop:

dcop kdesktop KBackgroundIface currentWallpaper 1

If you don't like the current wallpaper and would like to remove it from the list of wallpapers used for your automatic wallpaper changer, copy-and-paste this series of commands into a terminal:

OLDWALLPAPER=`dcop kdesktop KBackgroundIface currentWallpaper 1`
dcop kdesktop KBackgroundIface changeWallpaper
rm "$OLDWALLPAPER"

No comments: