From 9d664036a11d42559651984ec04fe344008e76bf Mon Sep 17 00:00:00 2001 From: Aaron Hewitt Date: Thu, 1 Dec 2022 19:12:07 +0000 Subject: [PATCH] Updated battery status script to check for acpi and use if present --- scripts/battery_status.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/battery_status.sh b/scripts/battery_status.sh index 6388ea5..9026e44 100755 --- a/scripts/battery_status.sh +++ b/scripts/battery_status.sh @@ -1,6 +1,10 @@ #!/usr/bin/env bash -find /sys/class/power_supply -type l -exec bash -c ' +#check for acpi +if command -v acpi &> /dev/null; then + 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##*/}" @@ -10,4 +14,4 @@ find /sys/class/power_supply -type l -exec bash -c ' fi done ' _ {} \; - +fi