sketchybar
change
commit d5e30d200db703e70ccb4d811e4f6e6e0c88dfb3
author Alpha Chen <alpha@kejadlen.dev>
date
parent ed905788
diff --git a/.config/sketchybar/plugins/battery.sh b/.config/sketchybar/plugins/battery.sh
index 72bee5fc..4de6cfce 100755
--- a/.config/sketchybar/plugins/battery.sh
+++ b/.config/sketchybar/plugins/battery.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 PERCENTAGE="$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1)"
 CHARGING="$(pmset -g batt | grep 'AC Power')"
@@ -23,6 +23,9 @@ if [[ "$CHARGING" != "" ]]; then
   ICON=􀢋
 fi
 
-# The item invoking this script (name $NAME) will get its icon and label
-# updated with the current battery status
 sketchybar --set "$NAME" icon="$ICON" label="$PERCENTAGE%"
+
+# TDOO Move into the above sketchybar command
+if (( PERCENTAGE < 20 )); then
+  sketchybar --set label.drawing=on
+fi
diff --git a/.config/sketchybar/sketchybarrc b/.config/sketchybar/sketchybarrc
index a5c5beb3..6d836ac5 100755
--- a/.config/sketchybar/sketchybarrc
+++ b/.config/sketchybar/sketchybarrc
@@ -65,6 +65,7 @@ sketchybar --add item front_app left \
 # https://felixkratz.github.io/SketchyBar/config/events
 
 sketchybar --add item datetime right \
+           --subscribe datetime system_woke \
            --set datetime update_freq=30 icon=􀉉 script="$PLUGIN_DIR/datetime.sh" \
            --add item wifi right \
            --subscribe wifi wifi_change \