aboutsummaryrefslogtreecommitdiff
path: root/macos/.config/sketchybar/plugins/battery.org
diff options
context:
space:
mode:
authorJacob Janzen <jacob.a.s.janzen@gmail.com>2024-10-01 17:42:59 -0500
committerJacob Janzen <jacob.a.s.janzen@gmail.com>2024-10-01 17:42:59 -0500
commit7b0ea5cbdaaa5b8392777ad207c74cb27411eab1 (patch)
tree37a3438116ec3c84663133c820808ad9e2acf021 /macos/.config/sketchybar/plugins/battery.org
parent7a347653dfad8c6c33791f7e72a4ec40b8230ac3 (diff)
the big refactor
Diffstat (limited to 'macos/.config/sketchybar/plugins/battery.org')
-rw-r--r--macos/.config/sketchybar/plugins/battery.org46
1 files changed, 0 insertions, 46 deletions
diff --git a/macos/.config/sketchybar/plugins/battery.org b/macos/.config/sketchybar/plugins/battery.org
deleted file mode 100644
index d3918e2..0000000
--- a/macos/.config/sketchybar/plugins/battery.org
+++ /dev/null
@@ -1,46 +0,0 @@
-#+title: SketchyBar Battery Plugin
-
-Get the percentage and charging status.
-#+begin_src sh :tangle ~/.config/sketchybar/plugins/battery.sh :mkdirp yes :tangle-mode o755
- #!/bin/sh
- PERCENTAGE="$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1)"
- CHARGING="$(pmset -g batt | grep 'AC Power')"
-#+end_src
-
-Exit if no percentage was reported.
-#+begin_src sh :tangle ~/.config/sketchybar/plugins/battery.sh :mkdirp yes :tangle-mode o755
- if [ "$PERCENTAGE" = "" ]; then
- exit 0
- fi
-#+end_src
-
-Choose the icon based on the percentage.
-#+begin_src sh :tangle ~/.config/sketchybar/plugins/battery.sh :mkdirp yes :tangle-mode o755
- if [[ "$CHARGING" != "" ]]; then
- case "${PERCENTAGE}" in
- 9[0-9]|100) ICON="󰂅"
- ;;
- [6-8][0-9]) ICON="󰂉"
- ;;
- [3-5][0-9]) ICON="󰂇"
- ;;
- [1-2][0-9]) ICON="󰢜"
- ;;
- ,*) ICON="󰁺"
- esac
- else
- case "${PERCENTAGE}" in
- 9[0-9]|100) ICON="󰁹"
- ;;
- [6-8][0-9]) ICON="󰁿"
- ;;
- [3-5][0-9]) ICON="󰁼"
- ;;
- [1-2][0-9]) ICON="󰁺"
- ;;
- ,*) ICON=""
- esac
- fi
-
- sketchybar --set "$NAME" icon="$ICON" label="${PERCENTAGE}%"
-#+end_src