autoformat hammerspoon and add calendar

This commit is contained in:
Noah Masur 2021-12-27 22:31:30 -07:00
parent b09a38201c
commit 6a0a27714b

View File

@ -1,17 +1,16 @@
--- === Launcher === --- === Launcher ===
local obj={} local obj = {}
obj.__index = obj obj.__index = obj
-- Metadata -- Metadata
obj.name = 'Launcher' obj.name = "Launcher"
obj.version = '0.1' obj.version = "0.1"
obj.license = 'MIT - https://opensource.org/licenses/MIT' obj.license = "MIT - https://opensource.org/licenses/MIT"
function obj:init() function obj:init()
-- Begin launcher mode -- Begin launcher mode
self.launcher = hs.hotkey.modal.new('ctrl', 'space') self.launcher = hs.hotkey.modal.new("ctrl", "space")
-- Behaviors on enter -- Behaviors on enter
function self.launcher:entered() function self.launcher:entered()
@ -23,22 +22,51 @@ function obj:init()
end end
-- Use escape to exit launcher mode -- Use escape to exit launcher mode
self.launcher:bind('', 'escape', function() self.launcher:exit() end) self.launcher:bind("", "escape", function()
self.launcher:exit()
end)
-- Launcher shortcuts -- Launcher shortcuts
self.launcher:bind('', 'space', function() hs.hints.windowHints(); self.launcher:exit() end) self.launcher:bind("", "space", function()
self.launcher:bind('', 'return', function() self:switch('Alacritty.app') end) hs.hints.windowHints()
self.launcher:bind('', 'D', function() self:switch('Discord.app') end) self.launcher:exit()
self.launcher:bind('', 'E', function() self:switch('Mail.app') end) end)
self.launcher:bind('', 'F', function() self:switch('Firefox.app') end) self.launcher:bind("", "return", function()
self.launcher:bind('', 'G', function() self:switch('Mimestream.app') end) self:switch("Alacritty.app")
self.launcher:bind('', 'M', function() self:switch('Messages.app') end) end)
self.launcher:bind('', 'O', function() self:switch('Obsidian.app') end) self.launcher:bind("", "C", function()
self.launcher:bind('', 'P', function() self:switch('System Preferences.app') end) self:switch("Calendar.app")
self.launcher:bind('', 'R', function() hs.reload() end) end)
self.launcher:bind('', 'S', function() self:switch('Slack.app') end) self.launcher:bind("", "D", function()
self.launcher:bind('', 'Z', function() self:switch('zoom.us.app') end) self:switch("Discord.app")
end)
self.launcher:bind("", "E", function()
self:switch("Mail.app")
end)
self.launcher:bind("", "F", function()
self:switch("Firefox.app")
end)
self.launcher:bind("", "G", function()
self:switch("Mimestream.app")
end)
self.launcher:bind("", "M", function()
self:switch("Messages.app")
end)
self.launcher:bind("", "O", function()
self:switch("Obsidian.app")
end)
self.launcher:bind("", "P", function()
self:switch("System Preferences.app")
end)
self.launcher:bind("", "R", function()
hs.reload()
end)
self.launcher:bind("", "S", function()
self:switch("Slack.app")
end)
self.launcher:bind("", "Z", function()
self:switch("zoom.us.app")
end)
end end
function obj:switch(app) function obj:switch(app)
@ -47,4 +75,3 @@ function obj:switch(app)
end end
return obj return obj