#!/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