From 2492b303c183669f735dde253a5afa05777258fd Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Sat, 13 Aug 2022 20:18:34 -0400 Subject: [PATCH] xinitrc: use more resilient command for battery status --- src/.xinitrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/.xinitrc b/src/.xinitrc index 6a43c09..b1c3e8c 100755 --- a/src/.xinitrc +++ b/src/.xinitrc @@ -24,7 +24,7 @@ export XMODIFIERS=@im=fcitx while true; do DATE=$(date +'%H:%M:%S %a %b %d') TEMP="$(($(cat /sys/class/thermal/thermal_zone0/temp) / 1000))C" - BAT="$(acpi | cut -f4 -d " " | tr -d ',')" + BAT="$(acpi -b | head -n 1 | awk -F'[,:]' '{print $3}' | tr -d '[:space:]')" KEY="$(xkblayout-state print '%s')" xsetroot -name " $DATE // $TEMP, $BAT // $KEY"