diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2019-11-13 23:56:34 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2019-11-13 23:56:34 +0100 |
commit | 60f7bab9ce3e3e34183c1405b6cbec4e545ee283 (patch) | |
tree | d8b5c4ef89b5ae6fdddce87c7194dbc16a59c73a | |
parent | Second (diff) | |
download | lowbat-gnu-60f7bab9ce3e3e34183c1405b6cbec4e545ee283.tar.gz lowbat-gnu-60f7bab9ce3e3e34183c1405b6cbec4e545ee283.tar.bz2 lowbat-gnu-60f7bab9ce3e3e34183c1405b6cbec4e545ee283.tar.xz lowbat-gnu-60f7bab9ce3e3e34183c1405b6cbec4e545ee283.tar.zst lowbat-gnu-60f7bab9ce3e3e34183c1405b6cbec4e545ee283.zip |
Better indentation
Diffstat (limited to '')
-rwxr-xr-x | bin/lowbat | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -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 |