-
Notifications
You must be signed in to change notification settings - Fork 248
/
Waterbongo.json
67 lines (62 loc) · 2.53 KB
/
Waterbongo.json
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
[
{
"type": "shellScriptTitledButton",
"align": "left",
"refreshInterval": 60,
"source": {
"inline": "HOUR=$(date +%H); if [ $HOUR -ge 6 ] && [ $HOUR -lt 8 ]; then echo \"🌅 $(date '+%a %I:%M %p')\"; elif [ $HOUR -ge 8 ] && [ $HOUR -lt 18 ]; then echo \"☀️ $(date '+%a %I:%M %p')\"; elif [ $HOUR -ge 18 ] && [ $HOUR -lt 20 ]; then echo \"🌇 $(date '+%a %I:%M %p')\"; else echo \"🌙 $(date '+%a %I:%M %p')\"; fi"
},
"bordered": false
},
{
"type": "weather",
"align": "left",
"api_key": "ca93a0bb8cdb428552660d83249e4bc9",
"units":"imperial",
"icon_type":"images",
"bordered": false
},
{
"type": "shellScriptTitledButton",
"refreshInterval": 2,
"source": {
"inline": "BAT=$(pmset -g batt | grep -o '[0-9]*%' | cut -d% -f1); MODE=$(pmset -g | grep lowpowermode | awk '{print $2}'); TIME=$(pmset -g batt | grep -o '[0-9]\\{1,2\\}:[0-9]\\{2\\}' || echo '(??)'); CHARGING=$(pmset -g batt | grep \"charging\" > /dev/null && echo '⚡️' || echo ''); if [ \"$MODE\" = '1' ]; then if [ \"$TIME\" = '(??)' ]; then echo \"⚡️ ${BAT}% \"; else echo \"⚡️ ${BAT}% ($TIME)\"; fi; else if [ \"$TIME\" = '(??)' ]; then echo \"🔋 ${BAT}%\"; else echo \"🔋 ${BAT}% ($TIME)\"; fi; fi"
},
"actions": [
{
"trigger": "singleTap",
"action": "appleScript",
"actionAppleScript": {
"inline": "tell application \"System Events\" to do shell script \"if [ $(pmset -g | grep lowpowermode | awk '{print $2}') = '1' ]; then pmset -a lowpowermode 0 && osascript -e 'display notification \\\"Low Power Mode has been disabled\\\" with title \\\"Power Mode Changed\\\"'; else pmset -a lowpowermode 1 && osascript -e 'display notification \\\"Low Power Mode has been enabled\\\" with title \\\"Power Mode Changed\\\"'; fi\" with administrator privileges"
}
}
],
"bordered": false,
"align": "left"
},
{
"type": "music",
"align": "left",
"bordered": false,
"refreshInterval": 2,
"disableMarquee": true
},
{
"type": "shellScriptTitledButton",
"refreshInterval": 1,
"align": "right",
"source": {
"inline": "VOL=$(osascript -e 'output volume of (get volume settings)'); echo \"🔊 ${VOL}%\""
},
"bordered": false
},
{
"type": "shellScriptTitledButton",
"refreshInterval": 1,
"align": "right",
"source": {
"inline": "BRIGHT=$(brightness -l | grep -i 'brightness' | awk '{print int($NF * 100)}'); if [ $BRIGHT -ge 70 ]; then echo \"🔆 ${BRIGHT}%\"; elif [ $BRIGHT -ge 30 ]; then echo \"🌤 ${BRIGHT}%\"; else echo \"💡 ${BRIGHT}%\"; fi"
},
"bordered": false
}
]