The following method uses the combination of Compiz to launch an application when a key-press is made.
In summary -
- change the behaviour of the Caps Lock key to mimic another key.
- Configure compiz to listen for the newly mimic'd key and run a custom script.
Change the caps lock key
Too change the behaviour of the Caps Lock Key, you can use
xmodmap as follows:
- create a file e.g. "capslock"
- copy and paste the following into the file
keycode 66 = cent
add Control = cent
- now run xmodmap to recognise your change:
To run permanently add this command to the startup applications.
Pressing Caps Lock now just mimics pressing a "cent" key - note this is not a key that actually exists on my keyboard.
You can get a list of KeySym names from here.
Start the CompizConfig Settings Manager
In the general section, ensure "Commands" is enabled and configure a command as shown:
N.B. enable the key binding and use "grab key combination" to recognise your "cent" key. You cannot get compiz to recognise the cap lock key itself unfortunately.
Obviously - change "firefox" for whatever command you use to start "launchy"
Now when you hit the Caps Lock key, compiz will recognise the mapped "cent" key and run the command - in this case firefox - in your case "launchy".