diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2019-12-04 00:23:45 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2019-12-04 00:23:45 +0100 |
commit | 86f4eeac510753024dd94b69988bed700446ef37 (patch) | |
tree | e2fddd65127ad0eeef58f5eb4e5c5c57cd23ae39 /bin | |
parent | .gitignore C++ update, doing some debug (diff) | |
download | lowbat-gnu-86f4eeac510753024dd94b69988bed700446ef37.tar.gz lowbat-gnu-86f4eeac510753024dd94b69988bed700446ef37.tar.bz2 lowbat-gnu-86f4eeac510753024dd94b69988bed700446ef37.tar.xz lowbat-gnu-86f4eeac510753024dd94b69988bed700446ef37.tar.zst lowbat-gnu-86f4eeac510753024dd94b69988bed700446ef37.zip |
Better now
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/lowbat | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/bin/lowbat b/bin/lowbat deleted file mode 100755 index 7aaaede..0000000 --- a/bin/lowbat +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -if [ ! "$1" = "--silent" ]; then - if [ ! "$1" = "--say" ]; then - message="beep beep - low battery" - else - message=$2 - fi -fi - -ntf() { - notify-send "Low battery: $batlvl%" "Please plug in computer" -u critical -t 15000 - if [ ! "$message" = "--silent" ]; then - echo "$message" | espeak - fi -} - -while true ; 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 - while [ "$acstat" = "Discharging" ]; do - ntf - 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 - fi - sleep 240 -done |