aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2019-11-15 10:23:18 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2019-11-15 10:23:18 +0100
commit1ac76536a281ad4305797393e2c846eb063f22ea (patch)
tree846d8f2b384f387fd91ed373e54f7bf35aa7fa31
parentHEAD conflicts (diff)
downloadlowbat-gnu-1ac76536a281ad4305797393e2c846eb063f22ea.tar.gz
lowbat-gnu-1ac76536a281ad4305797393e2c846eb063f22ea.tar.bz2
lowbat-gnu-1ac76536a281ad4305797393e2c846eb063f22ea.tar.xz
lowbat-gnu-1ac76536a281ad4305797393e2c846eb063f22ea.tar.zst
lowbat-gnu-1ac76536a281ad4305797393e2c846eb063f22ea.zip
Now handles no-audio
-rwxr-xr-xbin/lowbat5
1 files changed, 2 insertions, 3 deletions
diff --git a/bin/lowbat b/bin/lowbat
index 765d818..99836a0 100755
--- a/bin/lowbat
+++ b/bin/lowbat
@@ -8,8 +8,7 @@ fi
notify() {
notify-send "Low battery: $batlvl%" "Please plug in computer" -u critical -t 15000
- if [ "$message" = "no-audio" ]; then
- else
+ if [ ! "$message" = "no-audio" ]; then
echo "$message" | espeak
fi
}
@@ -17,7 +16,7 @@ notify() {
while [ 1 ]; do
acstat=$(acpi | awk '{print $3}' | rev | cut -c 2- | rev)
batlvl=$(acpi | awk '{print $4}' | rev | cut -c 3- | rev)
- if [ $batlvl -lt 115 ]; then
+ if [ $batlvl -lt 15 ]; then
while [ "$acstat" = "Discharging" ]; do
$(notify)
sleep 20