summaryrefslogtreecommitdiff
path: root/.local/bin/statusbar/battery
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/statusbar/battery')
-rwxr-xr-x.local/bin/statusbar/battery42
1 files changed, 0 insertions, 42 deletions
diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery
deleted file mode 100755
index dfdc39c..0000000
--- a/.local/bin/statusbar/battery
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh
-for battery in /sys/class/power_supply/BAT?
-do
- # Get its remaining capacity and charge status.
- capacity=$(cat "$battery"/capacity) || break
- status=$(sed "s/[Dd]ischarging/discharging/;s/[Nn]ot charging/not_charging/;s/[Cc]harging/charging/;s/[Uu]nknown/unknown/;s/[Ff]ull/full/" "$battery"/status)
-
- if [ "$status" = "charging" ]; then
- if [ "$capacity" -le 20 ]; then
- icon=""
- elif [ "$capacity" -le 40 ]; then
- icon=""
- elif [ "$capacity" -le 60 ]; then
- icon=""
- elif [ "$capacity" -le 80 ]; then
- icon=""
- elif [ "$capacity" -lt 95 ]; then
- icon=""
- elif [ "$capacity" -le 100 ]; then
- icon=""
- fi
- elif [ "$status" = "discharging" ]; then
- if [ "$capacity" -le 20 ]; then
- icon=""
- elif [ "$capacity" -le 40 ]; then
- icon=""
- elif [ "$capacity" -le 60 ]; then
- icon=""
- elif [ "$capacity" -le 80 ]; then
- icon=""
- elif [ "$capacity" -lt 95 ]; then
- icon=""
- elif [ "$capacity" -le 100 ]; then
- icon=""
- fi
- elif [ "$status" = "full" ]; then
- icon=""
- fi
-
- # printf "%s %s%% " "$icon" "$capacity"
- printf "Battery: %s%%" "$capacity"
-done | sed 's/ *$//'