aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-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