-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.hue_control
More file actions
42 lines (32 loc) · 762 Bytes
/
.hue_control
File metadata and controls
42 lines (32 loc) · 762 Bytes
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
#!.hue_control
# TODO: For this to work you have to have openhue installed into a root
# owned directory. There's probably a better way to set this up...
OPENHUE_PATH="/opt/homebrew/bin"
HUE_LOCK="/tmp/.hue-toggle"
touch "$HUE_LOCK"
hue_reset() {
rm "$HUE_LOCK"
}
hue_is_color() {
test "$(cat "$HUE_LOCK" 2>/dev/null)" == "$1"
}
hue_is_red() {
hue_is_color red
}
hue_is_purple() {
hue_is_color purple
}
hue_is_green() {
hue_is_color green
}
hue_is_busy() {
hue_is_color busy
}
hue_set_color() {
echo "$1" >"$HUE_LOCK"
$OPENHUE_PATH/openhue set light Busy --on --brightness 40 --color "$1"
}
hue_set_busy() {
echo "busy" >"$HUE_LOCK"
$OPENHUE_PATH/openhue set light Busy --on --brightness 40 --color "$1"
}