From f009fcb92b9f65657bdf6e3bf9c1cc4ca809e0e5 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Sat, 29 Jul 2023 00:18:16 -0700 Subject: [PATCH] Update dwmblocks-battery --- scripts/dwmblocks-battery | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/scripts/dwmblocks-battery b/scripts/dwmblocks-battery index 219050b..f331c92 100755 --- a/scripts/dwmblocks-battery +++ b/scripts/dwmblocks-battery @@ -12,7 +12,7 @@ if [[ "$(uname)" = 'Linux' ]]; then ((${connected} == 1)) } - function get_discharging_battery_icon { + function print_battery_icon { let charge_percent="${1}" if ((${charge_percent} <= 10)); then echo -n '󰂃' @@ -37,35 +37,9 @@ if [[ "$(uname)" = 'Linux' ]]; then fi } - function get_charging_battery_icon { - let charge_percent="${1}" - if ((${charge_percent} <= 10)); then - echo -n '󰢜 ' - elif ((${charge_percent} <= 20)); then - echo -n '󰂆 ' - elif ((${charge_percent} <= 30)); then - echo -n '󰂇 ' - elif ((${charge_percent} <= 40)); then - echo -n '󰂈 ' - elif ((${charge_percent} <= 50)); then - echo -n '󰢝 ' - elif ((${charge_percent} <= 60)); then - echo -n '󰢝 ' - elif ((${charge_percent} <= 70)); then - echo -n '󰢞 ' - elif ((${charge_percent} <= 80)); then - echo -n '󰂊 ' - elif ((${charge_percent} < 100)); then - echo -n '󰂋 ' - else - echo -n '󰂅 ' - fi - } - let cp="$(get_battery_percent)" - is_adapted_connected \ - && get_charging_battery_icon "${cp}" \ - || get_discharging_battery_icon "${cp}" + print_battery_icon "${cp}" + is_adapted_connected && echo -n '󱐋' printf '%3d%%\n' "${cp}" # Linux ends here else