aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2019-11-15 11:00:25 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2019-11-15 11:00:25 +0100
commitfdfc3dbea277128504d43f0cdd93309830cc5cc1 (patch)
tree236f2d7807f36e0244c9594ebe93fd4a278f891f
parentConcrete man (diff)
downloadlowbat-gnu-fdfc3dbea277128504d43f0cdd93309830cc5cc1.tar.gz
lowbat-gnu-fdfc3dbea277128504d43f0cdd93309830cc5cc1.tar.bz2
lowbat-gnu-fdfc3dbea277128504d43f0cdd93309830cc5cc1.tar.xz
lowbat-gnu-fdfc3dbea277128504d43f0cdd93309830cc5cc1.tar.zst
lowbat-gnu-fdfc3dbea277128504d43f0cdd93309830cc5cc1.zip
Now takes the correct options
-rwxr-xr-xbin/lowbat12
1 files changed, 7 insertions, 5 deletions
diff --git a/bin/lowbat b/bin/lowbat
index db2a466..a8ae16c 100755
--- a/bin/lowbat
+++ b/bin/lowbat
@@ -1,9 +1,11 @@
#!/bin/sh
-if [ $# -lt 1 ]; then
- message="beep beep - low battery"
-else
- message=$1
+if [ ! "$1" = "--silent" ]; then
+ if [ ! "$1" = "--say" ]; then
+ message="beep beep - low battery"
+ else
+ message=$2
+ fi
fi
notify() {
@@ -16,7 +18,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 15 ]; then
+ if [ $batlvl -lt 115 ]; then
while [ "$acstat" = "Discharging" ]; do
$(notify)
sleep 20