aboutsummaryrefslogtreecommitdiffstats
path: root/bin/lowbat
diff options
context:
space:
mode:
Diffstat (limited to 'bin/lowbat')
-rwxr-xr-xbin/lowbat28
1 files changed, 14 insertions, 14 deletions
diff --git a/bin/lowbat b/bin/lowbat
index 0fde1e6..6b893a4 100755
--- a/bin/lowbat
+++ b/bin/lowbat
@@ -1,21 +1,21 @@
#!/bin/bash
notify() {
- notify-send "Low battery" "Please plug in computer" -u critical -t 15000
- echo "beep beep - low battery" | espeak
+ notify-send "Low battery" "Please plug in computer" -u critical -t 15000
+ echo "beep beep - low battery" | espeak
}
while [ 1 ]; do
- acstat=$(acpi | awk '{print $3}' | rev | cut -c 2- | rev)
- batlvl=$(acpi | awk '{print $4}' | rev | cut -c 3- | rev)
- while [[ $acstat == "Discharging" && $batlvl -lt 25 ]]; do
- $(notify)
- sleep 20
- acstat=$(acpi | awk '{print $3}' | rev | cut -c 2- | rev)
- batlvl=$(acpi | awk '{print $4}' | rev | cut -c 3- | rev)
- if [[ $acstat == "Charging" ]]; then
- break
- fi
- done
- sleep 240
+ acstat=$(acpi | awk '{print $3}' | rev | cut -c 2- | rev)
+ batlvl=$(acpi | awk '{print $4}' | rev | cut -c 3- | rev)
+ while [[ $acstat == "Discharging" && $batlvl -lt 25 ]]; do
+ $(notify)
+ sleep 20
+ acstat=$(acpi | awk '{print $3}' | rev | cut -c 2- | rev)
+ batlvl=$(acpi | awk '{print $4}' | rev | cut -c 3- | rev)
+ if [[ $acstat == "Charging" ]]; then
+ break
+ fi
+ done
+ sleep 240
done