From d5e30d200db703e70ccb4d811e4f6e6e0c88dfb3 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Mon, 1 Jul 2024 19:54:43 -0700 Subject: [PATCH] sketchybar --- .config/sketchybar/plugins/battery.sh | 9 ++++++--- .config/sketchybar/sketchybarrc | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.config/sketchybar/plugins/battery.sh b/.config/sketchybar/plugins/battery.sh index 72bee5f..4de6cfc 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 a5c5beb..6d836ac 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 \