-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
103 lines (86 loc) · 2.62 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
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
--------------------------------------------------------------------------------
-- CONSTANTS
--------------------------------------------------------------------------------
local cmd_alt = {"cmd", "alt"}
local cmd_alt_ctrl = {"cmd", "alt", "ctrl"}
local main_monitor = "Color LCD"
local second_monitor = ""
--------------------------------------------------------------------------------
-- (re)load
--------------------------------------------------------------------------------
-- reload Hammerspoon config
hs.hotkey.bind(cmd_alt_ctrl, "R", function()
savePasteboard()
hs.reload()
end)
-- load seperate config files
require("WiFi")
require("mouse")
require("windows")
require("audio")
require("redshift")
require("pasteboard")
require("Karabiner")
require("QuickChoose")
--------------------------------------------------------------------------------
--Caffeine --# @heptal gist
--------------------------------------------------------------------------------
ampOnIcon = [[ASCII:
.....1a..........AC..........E
..............................
......4.......................
1..........aA..........CE.....
e.2......4.3...........h......
..............................
..............................
.......................h......
e.2......6.3..........t..q....
5..........c..........s.......
......6..................q....
......................s..t....
.....5c.......................
]]
ampOffIcon = [[ASCII:
.....1a.....x....AC.y.......zE
..............................
......4.......................
1..........aA..........CE.....
e.2......4.3...........h......
..............................
..............................
.......................h......
e.2......6.3..........t..q....
5..........c..........s.......
......6..................q....
......................s..t....
...x.5c....y.......z..........
]]
-- caffeine replacement
local caffeine = hs.menubar.new()
function setCaffeineDisplay(state)
if state then
caffeine:setIcon(ampOnIcon)
else
caffeine:setIcon(ampOffIcon)
end
end
function caffeineClicked()
setCaffeineDisplay(hs.caffeinate.toggle("displayIdle"))
end
if caffeine then
caffeine:setClickCallback(caffeineClicked)
setCaffeineDisplay(hs.caffeinate.get("displayIdle"))
end
--------------------------------------------------------------------------------
-- extra timesavers
--------------------------------------------------------------------------------
-- hints
hs.hints.style = "vimperator"
hs.hotkey.bind(cmd_alt_ctrl, "H", function()
hs.hints.windowHints()
end)
-- weather menubar
local menubar = require "menubar"
menubar.init()
-- confirm config reload
hs.alert.show("Config loaded")