xinitrc: use more resilient command for battery status

This commit is contained in:
dogeystamp 2022-08-13 20:18:34 -04:00
parent dd1073cd6e
commit 2492b303c1
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

View File

@ -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"