Fix percentage char showing up on non-laptops

This commit is contained in:
Yannick7777 2024-08-19 23:14:30 +02:00
parent e7d835ffca
commit bdec905c08

View file

@ -117,7 +117,7 @@ label {
label {
monitor =
text = cmd[update:2000] echo "$(cat /sys/class/power_supply/BAT0/capacity | awk '{ if ($1 >= 90) icon=" "; else if ($1 >= 70) icon=" "; else if ($1 >= 50) icon=" "; else if ($1 >= 10) icon=" "; else icon=" ";} END {print $1 "%<span>" icon (system("grep -q Charging /sys/class/power_supply/BAT0/status") == 0 ? "󱐋" : "")"</span>"}')"
text = cmd[update:2000] echo "$(test -f /sys/class/power_supply/BAT0/model_name && cat /sys/class/power_supply/BAT0/capacity | awk '{ if ($1 >= 90) icon=" "; else if ($1 >= 70) icon=" "; else if ($1 >= 50) icon=" "; else if ($1 >= 10) icon=" "; else icon=" ";} END {print $1 "%<span>" icon (system("grep -q Charging /sys/class/power_supply/BAT0/status") == 0 ? "󱐋" : "")"</span>"}')"
text_align = center