From b4de391de022a491b8b90f4ba661de0b1048cb47 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 27 Nov 2018 13:56:32 -0500 Subject: [PATCH] =?UTF-8?q?extra=20battery=20warning=20=E2=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .scripts/statusbar/i3battery | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.scripts/statusbar/i3battery b/.scripts/statusbar/i3battery index c13e648..ba73baa 100755 --- a/.scripts/statusbar/i3battery +++ b/.scripts/statusbar/i3battery @@ -7,6 +7,7 @@ case $BLOCK_BUTTON in ♻: stagnant charge 🔌: charging ⚡: charged +❗: battery very low! - Text color reflects charge left" ;; esac @@ -23,8 +24,11 @@ elif [ "$capacity" -ge 20 ]; then color="#FFAE00" else color="#FF0000" + warn="❗" fi +[ -z $warn ] && warn=" " + [ "$status" = "Charging" ] && color="#FFF" -printf "%s %s" "$color" "$(echo "$status" | sed -e "s/,//g;s/Discharging/🔋/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$(echo "$capacity" | sed -e 's/$/%/')" +printf "%s%s%s" "$color" "$(echo "$status" | sed -e "s/,//g;s/Discharging/🔋/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/')"