Monday, December 21, 2009

Remapping the Show Desktop key combination on Gnome

I use both Ubuntu and Windows XP desktops at the same time. I am used to hitting Win+M on windows to minimize all my windows and show the desktop. It bugs me no end that I cannot do the same on Ubuntu. But some quick searching led me to 2 forum posts that helped me nail this. The default key combination for showing your desktop on Ubuntu is Ctrl+Alt+D. So the first thing you'll have to do is to assign a new sequence to that action. You do this by using either the gconftool command line tool or the gconf-editor GUI. The command line method works thus:


gconftool-2 -t str --set /apps/metacity/global_keybindings/show_desktop "<Super>m"


If you decide to use the gconf-editor tool instead, navigate to apps -> Metacity -> global_keybindings and look for the "show_desktop" key in the right side pane. Here replace the existing value with "<Super>m" (without the quotes).

If you have compiz installed the "Negative" plugin in compiz inverts your screen colors on hitting Win+M and restores your colors on hitting Win+M again. You'll have to disable this. If you use gconftool from the command line, here's the incantation that'll do the trick:


gconftool-2 -t str -s /apps/compiz/plugins/neg/allscreens/options/screen_toggle_key ""
gconftool-2 -t str -s /apps/compiz/plugins/neg/allscreens/options/window_toggle_key ""


If you choose to use the GUI gconf-editor instead, you'll have to navigate to the right key and update it's value, similar to the show_desktop example above.

And there you have it.

No comments: