Saturday, May 2, 2009

AutoHotkey Replacement for Linux / How to Activate Applications with Hot Keys

I love AutoHotkey for Windows because you can set up a key like Ctrl+Alt+F to activate the Firefox window if it's running.

From this thread, I discovered wmctrl and keylaunch:

sudo apt-get install keylaunch wmctrl

Then create a file ~/keylaunchrc. For example:


# Format:
# key=...KeyName:Command
#
# ... No modifier
# *.. Shift
# .*. Ctrl
# ..* Alt
key=.**f:wmctrl -a Mozilla Firefox   # Activate a window that contains 'Mozilla Firefox' in its title when you press Ctrl+Alt+F


Finally, you need to run keylaunch to get the hot keys working.

Also, check out launchy: It's very handy for launching an application by typing the name.


Matt

No comments:

Post a Comment