How to map your Windows key to the XFCE4 Menu

Environment

This is the version details for the system I did this on


cat /etc/redhat-release

Fedora Core release 5 (Bordeaux)


xfce4-about

Xfce 4 Desktop Environment

version 4.3.90.1 (Xfce 4.4 BETA1)

The steps to map the Windows Key to the XFCE4 Menu

  1. Run the xmodmap command as follows

    1. xmodmap -e "keycode 115 = Menu" &

  2. Run the XFCE4 Settings Manager

    1. xfce-settings-show

  3. Select the Keyboard Icon and the Shortcuts Tab

  4. Add a new Shortcut Theme. I named mine the same as my username

  5. Add a new command

    1. xfdesktop -menu

  6. Double click the the Shortcut column and then hit the windows key

    1. The word menu should appear in the Shortcut column

  7. Create a file ~/.xsession containing the following to make the key mapping persist across reboots and login & logouts

      #!/bin/sh
      xmodmap -e "keycode 115 = Menu" &

Explanation

This was garnered from the web

By default, the windows key is considered Super_L, a modifier key. Therefore you'd have to bind a command to windows+[some_key], which is not what we want. So what you want to do is re-map your windows key so that it's not a modifier. The easiest way to do this is to use xmodmap like so:

xmodmap -e "keycode 115 = Menu" &


"Menu" above specifies that when you press the windows key, it will pop-up the app's menu. We will later overwrite this to pop-up an Xfce menu. The 115 above is the keycode for the windows key. It should work for most people, but you can verify what it is for you with xev.

Now that you've changed your windows key to Menu, you can use it with one of the following shortcuts:

Code:

xfdesktop -menu <-- pops up the right-click menu
xfdesktop -windowlist <-- pops up the middle-click window list


If this all works out for you, you may wish to put the xmodmap command in your .xinitrc or .xsession file so that it will execute on startup. It definitely works with xfce-4.4 (svn) and I've heard it works in 4.2 as well (it should anyway).