Added status to the output in the batteryzu script. fixed the shabang. Fixed formatting.

This commit is contained in:
stormdragon2976 2022-12-01 16:36:06 -05:00
parent 722a028c8f
commit 33e9a0668e

View File

@ -1,7 +1,8 @@
#!/usr/bin/env bash
#check for acpi #check for acpi
if command -v acpi &> /dev/null; then if command -v acpi &> /dev/null; then
bat=$(acpi -b) bat="$(acpi -b)"
spd-say -P important -Cw "$bat" spd-say -P important -Cw "$bat"
else else
find /sys/class/power_supply -type l -exec bash -c ' find /sys/class/power_supply -type l -exec bash -c '
@ -9,9 +10,9 @@ else
if [[ -e "$i/capacity" ]]; then if [[ -e "$i/capacity" ]]; then
bat="${i##*/}" bat="${i##*/}"
bat="${bat//BAT/Battery }" bat="${bat//BAT/Battery }"
bat="${bat}: $(cat "${i}/capacity") percent" bat="${bat}: $( { cat "${i}/status";echo -n ", "; cat "${i}/capacity"; } | tr -d \\n) percent."
spd-say -P important -Cw "$bat" spd-say -P important -Cw "$bat"
fi fi
done done
' _ {} \; ' _ {} \;
fi fi