diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2019-11-15 11:00:25 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2019-11-15 11:00:25 +0100 |
commit | fdfc3dbea277128504d43f0cdd93309830cc5cc1 (patch) | |
tree | 236f2d7807f36e0244c9594ebe93fd4a278f891f | |
parent | Concrete man (diff) | |
download | lowbat-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-x | bin/lowbat | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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 |