Created
October 22, 2014 19:47
-
-
Save harizvi/6fc156267eaa497840ec to your computer and use it in GitHub Desktop.
Config for hydra
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
-- | |
-- Configuration for Hydra <https:--github.com/sdegutis/Hydra> | |
-- | |
-- Haider Rizvi <harizvi@gmail.com> | |
-- Started: Friday, July 25, 2014 6:22 PM | |
-- Update Time-stamp: <2014-09-22 08:56:10 haider> | |
-- | |
notify.show("Hydra", "Started!","","") | |
dofile(package.searchpath("grid", package.path)) | |
dofile(package.searchpath("appfinder", package.path)) | |
dofile(package.searchpath("cycle", package.path)) | |
dofile(package.searchpath("menuconf", package.path)) | |
dofile(package.searchpath("utilfns", package.path)) | |
local mash = {"cmd", "alt", "ctrl"} | |
local mashshift = {"cmd", "alt", "ctrl", "shift"} | |
-- keep an eye on my init directory, and restart as needed | |
pathwatcher.new(os.getenv("HOME") .. "/.hydra/", hydra.reload):start() | |
autolaunch.set(true) | |
-- open a repl | |
-- the repl is a Lua prompt; type "print('hello world')" | |
-- when you're in the repl, type "help" to get started | |
-- almost all readline functionality works in the repl | |
hotkey.bind(mashshift, "R", function() repl.open(); logger.show() end) | |
-- launch and focus applications | |
fnutils.each({ | |
{ key = "a", app = "Adium" }, | |
-- b = bp search thru quicksilver | |
-- c = calculator thru emacsclient | |
-- d = sunrise commander thru emacsclient | |
{ key = "e", app = "Emacs" }, | |
{ key = "f", app = "Firefox" }, | |
-- g = google search thru quicksilver | |
{ key = "i", app = "iNotes" }, | |
-- j = cobook | |
{ key = "k", app = "KeepassX" }, | |
-- l = evernote search | |
-- m = 'Mail'; | |
{ key = "m", app = "Mailbox (Beta)" }, | |
{ key = "n", app = "IBM Notes" }, | |
-- o unused | |
-- p = paste from clipboard with Evernote, mashshift-p: open new | |
-- q = 'Activity Monitor' thru quicksilver | |
-- r = remember thru emacsclient | |
{ key = "s", app = "Sametime" }, | |
{ key = "t", app = "iTerm" }, | |
-- u = unused | |
{ key = "v", app = "Evernote" }, | |
{ key = "w", app = "Conkeror" } | |
-- x = shell thru emacsclient | |
-- y unused | |
-- z = Finder window via applescript | |
}, function(object) | |
hotkey.bind(mash, object.key, function() | |
application.launchorfocus(object.app) | |
end) | |
end) | |
-- some emacs calls | |
fnutils.each({ | |
{key = "c", emacsfn = "make-calc-frame"}, | |
{key = "d", emacsfn = "make-sr-frame"}, | |
{key = "r", emacsfn = "make-orgcapture-frame"}, | |
{key = "x", emacsfn = "make-shell-frame"} | |
}, function(object) | |
hotkey.bind(mash, object.key, function() | |
hydra.exec("emacsclient -ne '(".. object.emacsfn .. ")'") | |
end | |
) | |
end | |
) | |
fnutils.each({ | |
{key = "z", applscpt = "Finder/Finder-newwindow.scpt"}, | |
{key = "f3", applscpt = "Adium/sendim2sr.applescript"} | |
}, function(object) | |
hotkey.bind(mash, object.key, function() | |
hydra.exec("osascript '/Users/haider/Library/Scripts/Applications/" .. object.applscpt .. "'") | |
end | |
) | |
end | |
) | |
--hotkey.bind(mash, 'z', function() | |
-- hydra.exec("osascript '/Users/haider/Library/Scripts/Applications/Finder/Finder-newwindow.scpt'") | |
--end) | |
hotkey.bind(mash, '=', function() | |
hydra.exec("open '/System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app'") | |
end) | |
hotkey.bind(mash, 'up', ext.grid.maximize_window) | |
hotkey.bind(mash, 'down', ext.grid.minimize_window) | |
hotkey.bind(mash, 'right', ext.utilfns.makewindowcycler({ | |
{0.50, 0, 0.50, 1}, | |
{0.25, 0, 0.75, 1}, | |
{0.34, 0, 0.66, 1} | |
})) | |
hotkey.bind(mash, 'left', ext.utilfns.makewindowcycler({ | |
{0, 0, 0.5, 1}, | |
{0, 0, 0.66, 1}, | |
{0, 0, 0.75, 1} | |
})) | |
-- also see http://elementaryos.org/journal/super-shortcuts | |
hotkey.bind(mashshift, 't', ext.utilfns.resizewindow_lefttopqtr) | |
hotkey.bind(mashshift, 'b', ext.utilfns.resizewindow_leftbtmqtr) | |
hotkey.bind(mashshift, 'y', ext.utilfns.resizewindow_righttopqtr) | |
hotkey.bind(mashshift, 'n', ext.utilfns.resizewindow_rightbtmqtr) | |
hotkey.bind(mashshift, 'g', ext.utilfns.smartlyPlaceWindow) | |
hotkey.bind(mashshift, 'j', ext.grid.pushwindow_down) | |
hotkey.bind(mashshift, 'k', ext.grid.pushwindow_up) | |
hotkey.bind(mashshift, 'h', ext.grid.pushwindow_left) | |
hotkey.bind(mashshift, 'l', function() | |
hydra.exec("open '/System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app'") | |
end) | |
hotkey.bind(mashshift, 'up', ext.grid.resizewindow_taller) | |
hotkey.bind(mashshift, 'right', ext.grid.resizewindow_wider) | |
hotkey.bind(mashshift, 'left', ext.grid.resizewindow_thinner) | |
hotkey.bind(mashshift, 'down', ext.grid.resizewindow_shorter) | |
hotkey.bind(mash, 'f6', ext.grid.center) | |
hotkey.bind(mash, 'f7', ext.utilfns.smartlyPlaceWindow) | |
hotkey.bind(mashshift, 'space', ext.utilfns.smartlyPlaceWindow) | |
hotkey.bind(mash, '3', function() ext.cycle.applicationwindows(1) end) | |
hotkey.bind(mash, '4', function() ext.cycle.applicationwindows(-1) end) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment