maphew

Use WinKey in Ubuntu

I use both windows and linux on a regular basis, and would like to optimise the number of things I need to remember distinctly. One of these categories is keyboard shortcuts. Although in Ubuntu Hardy System > Preferences > Keyboard Shortcuts brings up an application to easily view or assign keyboard shortcuts, out of the box the WinKey doesn't work in combination. It turns out one needs to change the keyboard layout option first so that winkey is treated as a single key. Courtesy of matthodge:

Re: Can't press Super L + other keys
Here is the solution :

  1. Goto System > Preferences > Keyboard
  2. Goto "Layout Options" tab.
  3. Expand "Alt/Win Behavior".
  4. Put the dot on "Super is mapped to the Win-keys (default)".
  5. Press close.
  6. Goto System > Preferences > Keyboard Shortcuts.
  7. Map your WinKey + Whatever combos.It should come up as "Mod4+ KEY"

For a technical method to see what the keys 0xae, 0×99,… are see https://help.ubuntu.com/community/MultimediaKeys

To map keyboard shortcuts to applications or functions not in the Keyboard Preferences list use gconf-editor. Geekzoid describes using
Use Winkey-E to start File Manager (Nautilus) on Ubuntu 8.04

Step 1: Disable current key binding of Winkey-E.
System->Preferences->Advanced Desktop Effects Settings
Go to Desktop->Expo->Bindings
Click on Super-E and disable it.

Step2: Add new bindings
prompt%> gconf-editor

Go to /Apps/metacity/global_keybidings
Set run_command_1 to < super >E (without any space)

Go to /Apps/metacity/keybinding_commands
Set command_1 to /usr/bin/nautilus

Gconf-editor can also be used from the command line. Here is how to map <ctrl><alt><del> to System Monitor:

gconftool-2 -t str --set /apps/metacity/global_keybindings/run_command_9 "<Control><Alt>Delete"

gconftool-2 -t str --set /apps/metacity/keybinding_commands/command_9 "gnome-system-monitor"

This example found in the Ubuntu Fiesty Guide, which for some reason is taken out of the Hardy Guide so use with care.

All of the above are per-user settings. I've not yet learned how to make them system defaults or apply from a script (to make it easy to bring the customizations with you from one computer to another).


date: 2009-10-17
tags: [linux]
category: Linux