Files
2026-05-16 13:01:39 -04:00

22 lines
641 B
Bash
Executable File

#!/bin/bash
# not useful unless exec commands can be placed in internal polybar modules
# or I can do the low discharging animation from here
BATRAW=$( cat /sys/class/power_supply/BAT0/capacity )
#STATUS=$( cat /sys/class/power_supply/BAT0/status )
STATUS="Charging"
BATADJ=$(( 9 + 100 * $BATRAW / 80 ))
STEP=$(( $BATADJ / 10 ))
CHARGING=( "󰢜" "󰂆" "󰂇" "󰂈" "󰢝" "󰂉" "󰢞" "󰂊" "󰂋" "󰂄" )
DISCHARGING=( "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹" )
if test $STATUS = "Discharging"; then
echo ${DISCHARGING[$STEP]}
elif test $STATUS = "Charging"; then
echo ${CHARGING[$STEP]}
fi