-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.lua
44 lines (40 loc) · 1.73 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
-- -----------------------------------------------------------------------
-- ** HammerSpoon Config File by S1ngS1ng with ❤️ ** --
-- -----------------------------------------------------------------------
-- *** Please refer to README.MD for instructions. Cheers! *** --
-- -----------------------------------------------------------------------
-- ** Something Global ** --
-- -----------------------------------------------------------------------
-- Uncomment this following line if you don't wish to see animations
-- hs.window.animationDuration = 0
-- -----------------------------------------------------------------------
-- ** Requires ** --
-- -----------------------------------------------------------------------
-- require "key-binding"
-- require("network-binding")
require("toggle-application")
-- require("windows")
require("input-method")
-- require("caffeinate")
-- -----------------------------------------------------------------------
-- ** For Debug ** --
-- -----------------------------------------------------------------------
local function reloadConfig(paths)
local doReload = false
for _, path in pairs(paths) do
print("reloadConfig path:" .. path)
if string.find(path, ".lua") then
print("has lua file")
doReload = true
break
end
end
if doReload then
hs.reload()
end
end
hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", reloadConfig):start()
hs.hotkey.bind({ "cmd", "alt", "ctrl" }, "h", function()
hs.reload()
end)
hs.alert.show("Config loaded")