battery script no longer uses pango
This commit is contained in:
parent
e826c95284
commit
6345394781
1 changed files with 7 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue