3 files changed,
6 insertions(+),
7 deletions(-)
Author:
Smirnov Oleksandr
ss2316544@gmail.com
Committed at:
2024-11-14 21:26:30 +0200
Parent:
61a2707
jump to
| M | bin/ex |
| M | bin/npm-install-globals |
| M | config/hypr/bat.sh |
M
bin/ex
M
config/hypr/bat.sh
ยทยทยท 3 3 # the purpose of the script is to notify when battery percentage is low 4 4 5 5 while true; do 6 - lvl=$(cat /sys/class/power_supply/BAT0/capacity) 7 - if [ "$lbl" -le 30 ]; then 8 - notify-send --urgency=CRITICAL "Battery Low" "Consider plugging cable in" 9 - sleep 1200 10 - else 11 - sleep 120 12 - fi 6 + if [[ "$(cat /sys/class/power_supply/BAT0/capacity)" -le 30 ]]; then 7 + notify-send --urgency=CRITICAL "Battery Low" "Consider plugging cable in" 8 + sleep 1200 9 + else 10 + sleep 120 11 + fi 13 12 done