Linux tip, Fedora tip / howto: different wallpapers for each workspace, with fast switching

Note that these tips are mostly outdated

back to notes and tips index

Try my online puzzle page with Calcudoku, Killer Sudoku and online Sudoku.

different wallpapers for each workspace, with fast switching

My setup is CentOS 6.4 running metacity and gnome.

Initially I tried the "wallpapoz" tool, only to find that (under Fedora 13 at least), it needs to run a daemon, and it overwrites your settings with the default settings at each restart (?!!).

Fortunately it turns out you don't need this tool at all.

I use Alt+F1 through Alt+F4 to select workspace 1 through 4. I'd like a different background for each workspace, and for it to change fast (not that ridiculously slow fade effect).

You need to have installed:

  • gconf-editor
  • GConf2
  • wmctrl
  • tcsh
(do a yum install for these as root)(bash will probably work just as well, see below)

Start gconf-editor, and go to apps → metacity → global keybindings. Right click on run_command_1 and select "Edit Key". Enter <Alt>F1 as the value (this is only if you want to bind switching to workspace 1 to that key, of course you can choose a different key combination). Do the same for run_command_2, run_command_3, and run_command_4.

Next, click on keybinding_commands in the left panel. Right click on command_1 and select "Edit Key". For the value, enter:

/bin/tcsh -c '/usr/bin/gconftool-2 -t string -s /desktop/gnome/background/picture_filename "<full path to first background image>"; /usr/bin/wmctrl -s 0'

Replace <full path to first background image> with the full path to the image you want to use as the background for workspace 1.

Do the same for command_2, command_3, and command_4, but replace the image file specification (obviously), and set the number for wmctrl to 1, 2, and 3 respectively (so for command_4, for example, the last bit of the command reads /usr/bin/wmctrl -s 3).

Finally, create/edit the file ~/.gtkrc-2.0, and add the line:
gtk-enable-animations = 0

Note that if you already had these shortcuts set in System → Preferences → Keyboard Shortcuts → Window Management, then you need to set those to "Disabled" (select them and press Backspace).

That should do it...

← back to notes and tips index
Please do not copy the text of this tip (© Patrick Min) to your web site.