Add control to hammerspoon hotkey, bind webapp

This commit is contained in:
2017-12-08 15:33:29 -08:00
parent b1575d8747
commit 60fccbb589
2 changed files with 12 additions and 10 deletions

View File

@@ -9,7 +9,7 @@ log.i('initializing')
--------------------------------------------------------------------------------
-- General ---------------------------------------------------------------------
local hyper = {'cmd', 'shift'}
local hyper = {'cmd', 'ctrl', 'shift'}
local hotkey = require 'hs.hotkey'
@@ -47,11 +47,6 @@ end tell
hs.osascript.applescript(chrome)
end
-- Open a new iTerm window
hotkey.bind(hyper, 'c', newTerm)
-- Open a new Chrome window
hotkey.bind(hyper, 'g', newBrowser)
-- Open a url (or prompt for one) and open as a chrome web app
function webApp(app)
local web = [[
@@ -60,6 +55,14 @@ do shell script "~/bin/webapp APP"
hs.osascript.applescript(string.gsub(web, "APP", app))
end
-- Open a new iTerm window
hotkey.bind(hyper, 'c', newTerm)
-- Open a new Chrome window
hotkey.bind(hyper, 'g', newBrowser)
-- Open a webapp
hotkey.bind(hyper, 'w', function () webApp("") end)
local screen = require 'hs.screen'
local window = require 'hs.window'
local geom = require 'hs.geometry'