From fdfc3dbea277128504d43f0cdd93309830cc5cc1 Mon Sep 17 00:00:00 2001
From: JozanLeClerc <bousset.rudy@gmail.com>
Date: Fri, 15 Nov 2019 11:00:25 +0100
Subject: Now takes the correct options

---
 bin/lowbat | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

(limited to 'bin/lowbat')

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
-- 
cgit v1.2.3