Added status to the output in the batteryzu script. fixed the shabang. Fixed formatting.
This commit is contained in:
parent
722a028c8f
commit
33e9a0668e
@ -1,17 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#check for acpi
|
||||
if command -v acpi &> /dev/null; then
|
||||
bat=$(acpi -b)
|
||||
bat="$(acpi -b)"
|
||||
spd-say -P important -Cw "$bat"
|
||||
else
|
||||
find /sys/class/power_supply -type l -exec bash -c '
|
||||
for i ; do
|
||||
if [[ -e "$i/capacity" ]]; then
|
||||
bat="${i##*/}"
|
||||
bat="${bat//BAT/Battery }"
|
||||
bat="${bat}: $(cat "${i}/capacity") percent"
|
||||
spd-say -P important -Cw "$bat"
|
||||
fi
|
||||
done
|
||||
' _ {} \;
|
||||
for i ; do
|
||||
if [[ -e "$i/capacity" ]]; then
|
||||
bat="${i##*/}"
|
||||
bat="${bat//BAT/Battery }"
|
||||
bat="${bat}: $( { cat "${i}/status";echo -n ", "; cat "${i}/capacity"; } | tr -d \\n) percent."
|
||||
spd-say -P important -Cw "$bat"
|
||||
fi
|
||||
done
|
||||
' _ {} \;
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user