-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.lua
56 lines (36 loc) · 1 KB
/
config.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
49
50
51
52
53
54
55
dofile(zwm.spoonPath.."utilities.lua")
-- Variables
config_file_path = os.getenv("HOME").. "/.zwm"
-- Parse configuration
local function parse(config)
if config ~= nil then
print("Configuration:")
print(hs.inspect(config))
local c = config
-- Key bindings
-- load mod keys
if c.keybindings ~= nil then
local k = c.keybindings
if k.mods ~= nil then
for index = 1, #k.mods do
if exact_in_table(k.mods[index], hs.keycodes.map) == nil then
log("mod: '".. k.mods[index] .."' not supported")
end
end
else
log("no mods found")
end
end
-- Spaces
-- reloads on config file change
if c.autoReload ~= nil and c.autoReload == true then
local config_watcher = hs.pathwatcher.new(config_file_path, load_config):start()
end
-- TODO: error checking
zwm.config = config
end
end
function load_config(config)
parse(config)
hs.alert.show("loaded config")
end