dotfiles

My dotfiles used for LARBS
Log | Files | Refs | README | LICENSE

commit 63453947814838680f76f593d20d0e032c821f3e
parent e826c95284dbbdbd1e4345e53adb3c701296aafd
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Fri, 28 Feb 2020 16:34:46 -0500

battery script no longer uses pango

Diffstat:
M.local/bin/statusbar/battery | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery @@ -11,8 +11,10 @@ case $BLOCK_BUTTON in - Text color reflects charge left" ;; esac -capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit -status=$(cat /sys/class/power_supply/"$1"/status) +for battery in /sys/class/power_supply/BAT? +do +capacity=$(cat "$battery"/capacity) || exit +status=$(cat "$battery"/status) if [ "$capacity" -ge 75 ]; then color="#00ff00" @@ -29,4 +31,6 @@ fi [ "$status" = "Charging" ] && color="#ffffff" -printf "<span color='%s'>%s%s%s</span>\n" "$color" "$(echo "$status" | sed -e "s/,//;s/Discharging/🔋/;s/Not charging/🛑/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/')" +printf "%s%s%s\n" "$(echo "$status" | sed "s/,//;s/Discharging/🔋/;s/Not charging/🛑/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/')" +done +