-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
48 lines (40 loc) · 1.33 KB
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
-- lua basics:
-- - http://tylerneylon.com/a/learn-lua/
-- - http://luatut.com/crash_course.html
-- - https://ebens.me/post/lua-for-programmers-part-1/
-- - https://ebens.me/post/lua-for-programmers-part-2/
-- - https://ebens.me/post/lua-for-programmers-part-4/
-- - https://somedudesays.com/2019/07/lua-tutorial-basics/
require "usb"
require "wifi"
require "menus"
-- suppress warnings
hs.luaSkinLog.setLogLevel("warning")
hs.hotkey.setLogLevel("warning")
hs.window.filter.setLogLevel("error")
-- hyper key
hyper = { 'shift', 'ctrl', 'alt', 'cmd' }
-- application hotkeys
hs.fnutils.each({
{ key = "a", app = "Visual Studio Code" },
{ key = "s", app = "Google Chrome" },
{ key = "]", app = "System Preferences" },
{ key = "e", app = "Sublime Text" },
{ key = "f", app = "Finder" },
{ key = "g", app = "Fork" }, -- git
{ key = "i", app = "IINA" }, -- video viewer
{ key = "m", app = "Marta" }, -- finder alt.
{ key = "t", app = "Todoist" },
{ key = "z", app = "iTerm" },
}, function(item)
local appActivation = function()
hs.application.launchOrFocus(item.app)
local app = hs.appfinder.appFromName(item.app)
if app then
app:activate()
app:unhide()
end
end
hs.hotkey.bind(hyper, item.key, appActivation)
end)
hs.alert.show("Config loaded 👍")