KDE 4.1: Open the menu with the windows key

Update: not quite right the first time through, now corrected.
Update 2: This may not work on all keyboards. See the comments.
Update 3:  Fixed spacing.  See the comments.

The KDE developers probably have strong religious reasons for preventing the windows key from popping up the KDE menu by default. Whatever. For me, using the windows key to launch a menu is too habitual to give up, so I wanted to reconfigure KDE accordingly. Lots of guides exist online to do exactly that, but it seems most are not up-to-date for Kubuntu 8.10. I found the following command line procedure to work:

cat << EOF >> $HOME/.xmodmaprc
remove mod4 = Super_L
keysym Super_L = F14
EOF
cat << EOF >> $HOME/.kde/Autostart/remap_keys.sh
#!/bin/sh
xmodmap $HOME/.xmodmaprc
EOF
chmod 755 $HOME/.kde/Autostart/remap_keys.sh
$HOME/.kde/Autostart/remap_keys.sh

The first command creates a file called .xmodmaprc telling X windows to stop using the Left Superkey, aka the Windows key, as a meta key. Instead, it should be mapped to the F14 key. The second set of commands creates a script which will call the remapping in .xmodmaprc every time KDE starts up. The third command makes that script executable, and the fourth command runs the remapping for the current KDE session so it’s not necessary to restart KDE before enjoying the changes. Finally, it’s necessary to go into the KDE control panel (called “System Settings” in Kubuntu) and set the keyboard shortcut for the KDE menu. In the control panel, select “Keyboard & Mouse”, then select “Keyboard Shortcuts”, then edit the shortcuts for the “Plasma Workspace” KDE component. There you’ll find the shortcut setting for the “Application Launcher”. Set it to your windows key and you’re done. Enjoy the illicit pleasure of driving KDE with a windows key!

15 Responses to “KDE 4.1: Open the menu with the windows key”

  1. jasond

    Hey, Aaron, I’m really grateful for this information but, sadly, I couldn’t get this to work. Just FYI, I’m running Kubuntu 8.10 on a Dell Precision M2400 laptop, with a 64-bit SMP kernel, and KDE 4.1.2. I’m not sure what other information would be helpful since I haven’t really played with Linux since Debian Etch on a P4 Northwood. So, when I enter these commands I get the following errors:

    xmodmap: /home/[user]/.xmodmaprc:1: bad remove modifier name ‘mod4=super_l’, not allowed
    xmodmap: /home/[user]/.xmodmaprc:2: bad keysym target key symbol ‘Super_L=F14′
    xmodmap: 2 errors encountered, aborting.

    Do you have insights into this? I’d really appreciate some feedback! Thanks!

  2. koadman

    The instructions on other sites for remapping the win key don’t usually give Super_L but use a hexadecimal keycode instead. I used Super_L because I found it by running xmodmap with no arguments. I wonder if the Super_L symbol name is specific to some keyboards and layout settings, so that it might be used on my MSI Wind but not on your Dell Precision? Maybe running xmodmap without arguments will give you an idea of which key to remap instead of Super_L? By the way, I think xmodmap is case-sensitive: I noticed super_l instead of Super_L your post.

  3. deke

    jasond: I also saw this. Make sure there are spaces before and after the “=” in the .xmodmaprc file.

    remove mod4[space]=[space]Super_L.

  4. JJ

    Thanks for the guide

    Works out of the box on kde 3.5.10 with xorg evdev keyboard

  5. Stanley

    Thanks, man! this was exactly what I was looking for!

  6. **Juanito**

    Awesome! Works amazing in openSUSE 11.2 but instead of $HOME/.kde/Autostart/remap_keys.sh y write $HOME/.kde4/Autostart/remap_keys.sh that is my version of KDE

  7. Herb

    Is there a way to do it without changing the key? I actually use it for other things so it has to be mod4? I mean, come on, it should work as well or better that windows. I mean come on. I’m trying KDE 4.3 for the first thing, and nothing works. Volume buttons on my keyboard do nothing. KDE is SHIT. I’m going back to fluxbox.

  8. Will

    Still works like a charm for Ubuntu 9.10 (64-bit). Thanks!

  9. dan

    I got the same error as JasonD but a logout/login fixed the issue.

  10. Matt

    Thanks mate! I love it.

  11. Ty

    Tried this for a bit; decided to switch back. Can you tell me how to modify the code so that I can revert back to the original functionality?

  12. Ben

    Hi guys – if you screw up and xmodmap reports errors, simply type ‘xkbmap’ to reset things. Then try again.

  13. sujendra

    Hi,
    Thanks for mentioning this point; works out of the box for Kubuntu 11(2.6.38-8-generic) as well..!!

  14. neemzy

    Hello,

    This still works perfectly with Kubuntu 12.04, thanks for the tip !

  15. Martijn

    Now you can’t use the super key as a modifier anymore, which would have been useful. Nice attempt, but not quite there yet.

Leave a Reply


Louis Vuitton Bag China Made Louis Vuitton Bags and Handbags Buy Louis Vuitton at Wholesale Buy Cheap Louis Vuitton Backpack Louis Vuitton Canvas Bucket Louis Vuitton Handbags Cheap from China Louis Vuitton Handbags Collection 2009 Louis Vuitton Damier Azur Canvas Backpack Graphite Louis Vuitton Damier Bag Louis Vuitton Outlet Store in Abu Dhabi UAE Louis Vuitton Purses Cheap Price Louis Vuitton Purses Cross Over Imitation Louis Vuitton Bags Online Imitation Louis Vuitton Shoes Louis Vuitton Damier Azur Neverfull Replica Replica Louis Vuitton Monogram Canvas Galliera GM Louis Vuitton Bags Average Cost Louis Vuitton Shop in Berlin Germany Louis Vuitton USA Store Louis Vuitton Wallets Fashion