Ubuntu – Remap Caps Lock key to ‘Run Command’ (Alt+F2)


I'm trying to get rid of the Caps Lockkey and give it a better use. Since I constantly use the run command Alt+F2, I'd like to make Caps Lock trigger that action.

I've found a couple of questions related, using xmodmap, but none of them try to map Caps Lock to a combination of keys such as Alt+F2

How would I go about doing this?


Best Answer

    1. Install Xdotool Install xdotool and CompizConfig Settings Manager Install compizconfig-settings-manager from Ubuntu Software Center

    2. Disable Caps-Lock by opening Keyboard Preferences

      System ▸ Preferences ▸ Keyboard

      Goto tab Layouts then click the button Options...

      Change the key behaviour to CapsLock is disabled

      enter image description here

    3. Open CompizConfig Settings Manager

      • Use Run Command, Alt + F2, and type ccsm
    4. Enable Commands plugin then add the following

      • Add xdotool key alt+F2 to the first available command slot

      • Goto 'Key Bindings' tab. In the same slot number assign Caps Lock key.

        Note: It will show VoidSymbol as the button assigned but this is fine.

        enter image description here

        enter image description here