Created
December 12, 2008 05:44
-
-
Save norio/35028 to your computer and use it in GitHub Desktop.
undefined
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'osx/cocoa' | |
require 'osx/hotkey' | |
def open_app(name) | |
`open /Applications/#{name}.app` | |
end | |
hotkeys = 'Command+Control' | |
app_list = { | |
'WebKit' => 'w', | |
'Firefox' => 'f', | |
'TextMate' => 'e', | |
'Yummy\ FTP' => 'r', | |
'1Password' => '1', | |
'Path\ Finder'=> '2', | |
'PeraPeraPrv' => '3', | |
'Gmail' => 'g', | |
'OmniFocus' => 'o', | |
'Utilities/Terminal' => 't', | |
} | |
app = NSApplicationWithHotKey.sharedApplication | |
app_list.each do |name, key| | |
app.register_hotkey("#{hotkeys}+#{key}") { open_app(name) } | |
end | |
app.run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment