-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
77 lines (67 loc) · 2.8 KB
/
init.lua
File metadata and controls
77 lines (67 loc) · 2.8 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
-- Load those Spoons
if not hspoon_list then
hspoon_list = {
"WinWin",
"HSaria2",
"KSheet",
"IFLookupSelection",
"TerminalHere",
"HotKeyList",
"BreakTime"
}
end
for _, v in pairs(hspoon_list) do
hs.loadSpoon(v)
end
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "R", "Configuration Reload", function()
hs.reload()
end)
-- WinWin (SizeUp HotKeys)
if spoon.WinWin then
-- Side
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "left", "Window ⬅", function() spoon.WinWin:moveAndResize("halfleft") end)
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "right", "Window ➡", function() spoon.WinWin:moveAndResize("halfright") end)
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "up", "Window ⬆", function() spoon.WinWin:moveAndResize("halfup") end)
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "down", "Window ⬇", function() spoon.WinWin:moveAndResize("halfdown") end)
-- Corner
hs.hotkey.bind({"shift", "alt", "ctrl"}, "left", "Window ↖", function() spoon.WinWin:moveAndResize("cornerNW") end)
hs.hotkey.bind({"shift", "alt", "ctrl"}, "right", "Window ↘", function() spoon.WinWin:moveAndResize("cornerSE") end)
hs.hotkey.bind({"shift", "alt", "ctrl"}, "up", "Window ↗", function() spoon.WinWin:moveAndResize("cornerNE") end)
hs.hotkey.bind({"shift", "alt", "ctrl"}, "down", "Window ↙", function() spoon.WinWin:moveAndResize("cornerSW") end)
-- Stretch
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "C", "Window Center", function() spoon.WinWin:moveAndResize("center") end)
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "M", "Window ↕↔", function() spoon.WinWin:moveAndResize("maximize") end)
-- Screen
hs.hotkey.bind({"alt", "ctrl"}, "right", "Window ➡ 🖥", function() spoon.WinWin:moveToScreen("next") end)
-- Other
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "/", "Window Undo", function() spoon.WinWin:undo() end)
end
-- HSaria2
if spoon.HSaria2 then
-- aria2c --enable-rpc --rpc-allow-origin-all -D
aria2Host = "http://localhost:6800/jsonrpc"
aria2Secret = ""
spoon.HSaria2:connectToHost(aria2Host, aria2Secret)
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "D", "Toggle Aria2", function() spoon.HSaria2:togglePanel() end)
end
-- KSheet
if spoon.KSheet then
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "K", "Show Cheatsheet", function() spoon.KSheet:show() end, function() spoon.KSheet:hide() end)
end
-- IFLookupSelection
if spoon.IFLookupSelection then
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "L", "Look up in Lexico", function() spoon.IFLookupSelection:openLexico() end)
end
-- TerminalHere
if spoon.TerminalHere then
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "T", "Terminal Here", function() spoon.TerminalHere:openTerminal() end)
end
-- HotKeyList
if spoon.HotKeyList then
spoon.HotKeyList:refresh()
end
-- BreakTime
if spoon.BreakTime then
spoon.BreakTime:start()
end
hs.alert.show("Config Reloaded")