mirror of
https://git.korhonen.cc/FunctionalHacker/dotfiles.git
synced 2024-11-04 18:00:20 +00:00
b1335a3628
Signed-off-by: Marko Korhonen <marko.korhonen@reekynet.com>
10 lines
206 B
Bash
Executable File
10 lines
206 B
Bash
Executable File
#!/bin/sh
|
|
acpi -b | awk -F'[,:%]' '{print $2, $3}' | {
|
|
read -r status capacity
|
|
|
|
if [ "$status" = Discharging -a "$capacity" -lt 5 ]; then
|
|
logger "Critical battery threshold"
|
|
systemctl hibernate
|
|
fi
|
|
}
|