summaryrefslogtreecommitdiff
path: root/mac/.config/sketchybar/plugins/battery.sh
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-08-23 12:42:37 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-08-23 12:42:37 +0900
commit07d294425a98ee5d1e22d03e2b24ae2c76e487c0 (patch)
treea6818f0d64438c5fdb88b00a35d944f80c056213 /mac/.config/sketchybar/plugins/battery.sh
parent6fc28cdb3529ca8ee864cb5c41674cb0a4af72a1 (diff)
updates
Diffstat (limited to 'mac/.config/sketchybar/plugins/battery.sh')
-rw-r--r--mac/.config/sketchybar/plugins/battery.sh85
1 files changed, 0 insertions, 85 deletions
diff --git a/mac/.config/sketchybar/plugins/battery.sh b/mac/.config/sketchybar/plugins/battery.sh
deleted file mode 100644
index 60a8dc4..0000000
--- a/mac/.config/sketchybar/plugins/battery.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/bash
-
-source "$CONFIG_DIR/colors.sh"
-
-render_item() {
-
- PERCENTAGE=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1)
- CHARGING=$(pmset -g batt | grep 'AC Power')
- CHARGING_STATUS="Not charging"
-
- if [ $PERCENTAGE = "" ]; then
- exit 0
- fi
-
- COLOR=$LABEL_COLOR
- ICON="󰁹"
-
- case ${PERCENTAGE} in
- 9[0-9])
- ICON="󰂂"
- ;;
- 8[0-9])
- ICON="󰂁"
- ;;
- 7[0-9])
- ICON="󰂀"
- ;;
- 6[0-9])
- ICON="󰁿"
- ;;
- 5[0-9])
- ICON="󰁾"
- ;;
- 4[0-9])
- ICON="󰁽"
- ;;
- 3[0-9])
- ICON="󰁼"
- ;;
- 2[0-9])
- ICON="󰁻"
- ;;
- 1[0-9])
- ICON="󰁺"
- ;;
- *)
- ICON="󰂎"
- COLOR=$RED
- ;;
- esac
-
- if [[ $CHARGING != "" ]]; then
- ICON="󰂄"
- CHARGING_STATUS="Charging"
- COLOR=$LABEL_COLOR
- fi
-
- sketchybar --set battery icon=$ICON
-
-}
-
-render_popup() {
- sketchybar --set battery.details label="$PERCENTAGE% (${CHARGING_STATUS})"
-}
-
-update() {
- render_item
- render_popup
-}
-
-popup() {
- sketchybar --set "$NAME" popup.drawing="$1"
-}
-
-case "$SENDER" in
-"routine" | "forced" | "power_source_change")
- update
- ;;
-"mouse.entered")
- popup on
- ;;
-"mouse.exited" | "mouse.exited.global")
- popup off
- ;;
-esac