diff 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 |