Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

46 lines
1.3 KiB

#!/bin/bash
source ~/.config/config.env
ramp10=
ramp20=
ramp30=
ramp40=
ramp50=
ramp60=
ramp70=
ramp80=
ramp90=
ramp100=
ac_bat=
ac=
if [ "$NO_BAT" = true ] ; then
echo "^c#ebcb8b^$ac^d^"
else
export bat=$(cat /sys/class/power_supply/BAT0/capacity)
export status=$(cat /sys/class/power_supply/BAT0/status)
export plugged=$(cat /sys/class/power_supply/AC/online)
if [[ $plugged == "1" ]]; then
echo "^c#ebcb8b^$ac_bat^d^ $bat%"
elif [[ $bat -lt 10 ]]; then
echo "^c#ebcb8b^$ramp10^d^ $bat% "
elif [[ $bat -lt 20 ]]; then
echo "^c#ebcb8b^$ramp20^d^ $bat% "
elif [[ $bat -lt "30" ]]; then
echo "^c#ebcb8b^$ramp30^d^ $bat% "
elif [[ $bat -lt "40" ]]; then
echo "^c#ebcb8b^$ramp40^d^ $bat% "
elif [[ $bat -lt "50" ]]; then
echo "^c#ebcb8b^$ramp50^d^ $bat% "
elif [[ $bat -lt "60" ]]; then
echo "^c#ebcb8b^$ramp60^d^ $bat% "
elif [[ $bat -lt "70" ]]; then
echo "^c#ebcb8b^$ramp70^d^ $bat% "
elif [[ $bat -lt "80" ]]; then
echo "^c#ebcb8b^$ramp80^d^ $bat% "
elif [[ $bat -lt "90" ]]; then
echo "^c#ebcb8b^$ramp90^d^ $bat% "
elif [[ $bat -le "100" ]]; then
echo "^c#ebcb8b^$ramp100^d^ $bat% "
fi
fi