From 1329c5357078e3c9f74691ce0b1284f0035a3156 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 4 Aug 2023 17:05:14 +0300 Subject: [PATCH] add better battery script --- config/dwm/scripts/bar.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/dwm/scripts/bar.sh b/config/dwm/scripts/bar.sh index 0a6ac8ef..89842387 100755 --- a/config/dwm/scripts/bar.sh +++ b/config/dwm/scripts/bar.sh @@ -18,7 +18,11 @@ cpu() { battery() { get_capacity="$(cat /sys/class/power_supply/BAT1/capacity)" get_status="$(cat /sys/class/power_supply/BAT1/status)" - printf "^c$blue^  $get_capacity" + case "$get_status" in + Charging) printf "^c$blue^ Charging $get_capacity" ;; + Discharging) printf "^c$blue^  $get_capacity" ;; + esac + #printf "^c$blue^  $get_capacity" } brightness() {