From 3b71a182d25b6da993695df9800a75720443299f Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Thu, 17 Feb 2022 18:18:59 +0100 Subject: [PATCH] =?UTF-8?q?Use=20the=20new=20=F0=9F=AA=AB=20emoji=20in=20s?= =?UTF-8?q?b-battery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the battery goes below 50%, the icon now changes to this one --- .local/bin/statusbar/sb-battery | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.local/bin/statusbar/sb-battery b/.local/bin/statusbar/sb-battery index 93cbe088..e53e2677 100755 --- a/.local/bin/statusbar/sb-battery +++ b/.local/bin/statusbar/sb-battery @@ -9,6 +9,7 @@ case $BLOCK_BUTTON in â™ģ: stagnant charge 🔌: charging ⚡: charged +đŸĒĢ: less than 50% remaining ❗: battery very low! - Scroll to change adjust xbacklight." ;; 4) xbacklight -inc 10 ;; @@ -30,8 +31,12 @@ for battery in /sys/class/power_supply/BAT?*; do *) exit 1 ;; esac capacity="$(cat "$battery/capacity" 2>&1)" - # Will make a warn variable if discharging and low - [ "$status" = "🔋" ] && [ "$capacity" -le 25 ] && warn="❗" + if [ "$status" = "🔋" ]; then + # Changes the icon if lower than 50% and discharging + [ "$capacity" -le 50 ] && status="đŸĒĢ" + # Will make a warn variable if discharging and very low + [ "$capacity" -le 25 ] && warn="❗" + fi # Prints the info printf "%s%s%d%%" "$status" "$warn" "$capacity"; unset warn done && printf "\\n"