forked from S1ngS1ng/HammerSpoon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
42 lines (37 loc) · 1.63 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
-- -----------------------------------------------------------------------
-- ** 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 "window-management"
require "vox-control"
require "vim-binding"
require "key-binding"
-- -----------------------------------------------------------------------
-- ** For Debug ** --
-- -----------------------------------------------------------------------
function reloadConfig(files)
local doReload = false
for _,file in pairs(files) do
if file:sub(-4) == ".lua" then
doReload = true
end
end
if doReload then
hs.reload()
hs.alert.show('Config Reloaded')
end
end
hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", reloadConfig):start()
-- Well, sometimes auto-reload is not working, you know u.u
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "n", function()
hs.reload()
end)
hs.alert.show("Config loaded")