Enjoy Slackware 15.0!

Welcome to the Slackware Documentation Project

Fluxbox: Setting Different Wallpapers On Different Workspaces

I've seen several different ways come up with google search but here's the one I like most because it does not require adding anything to fluxbox itself and it's basically entirely documented in the fluxbox-keys man page, I just made a very minor change to match the image numbers with the workspace numbers.

Fluxbox keys has an interesting feature, it has some special “keys” that let you bind events to non-keyboard events. One such event is ChangeWorkspace.

By adding one simple line in ~/fluxbox/keys we can tell fluxbox to change the wallpaper every time the workspace changes. The snag is having it to load a different image for each workspace, but some unixcraft can be used to acheive that:

#This executes fbsetbg every time workspace is changed to loas <workspace number>.jpg from ~/.fluxbox/backgrounds/
ChangeWorkspace :Exec fbsetbg ~/.fluxbox/backgrounds/$(xprop -root _NET_CURRENT_DESKTOP |awk '{print $3+1}').jpg

Then just have numbered jpg images in ~/.fluxbox/backgrounds/

drao@darkstar:~/.fluxbox$ ls -l ~/.fluxbox/backgrounds/?.jpg
-rw-r--r-- 1 drao users 1482678 Feb  9 11:07 /home/drao/.fluxbox/backgrounds/1.jpg
-rw-r--r-- 1 drao users 2220217 Feb  9 11:08 /home/drao/.fluxbox/backgrounds/2.jpg
-rw-r--r-- 1 drao users 1487753 Feb  9 11:15 /home/drao/.fluxbox/backgrounds/3.jpg
-rw-r--r-- 1 drao users 2187858 Feb  9 11:15 /home/drao/.fluxbox/backgrounds/4.jpg

There may be times where at startup no wallpaper is loaded so you might like to add this to ~/.flucbox/init to reload the last wallpaper:

session.screen0.rootCommand: fbsetbg -l


In Other Languages
Translations of this page?:
QR Code
QR Code howtos:misc:fluxbox_setting_different_wallpapers_on_different_workspaces (generated for current page)