From b3f9f3c05d993ecb53071a2a56d2d9a98f1da29d Mon Sep 17 00:00:00 2001 From: "flyingscorpio@clevo" Date: Mon, 14 Feb 2022 14:41:39 +0100 Subject: [PATCH] Don't nag when cable is plugged in --- dotfiles/i3/scripts/battery | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotfiles/i3/scripts/battery b/dotfiles/i3/scripts/battery index c69526d..a1c5f89 100755 --- a/dotfiles/i3/scripts/battery +++ b/dotfiles/i3/scripts/battery @@ -4,7 +4,7 @@ icon="" percent="$(upower -d | grep 'percentage' | awk '{print $2}' | head -n 1)" remaining="$(upower -d | grep 'time to empty' | awk -F: '{print $2}' | awk '{print $1,$2}' | head -n 1)" -if [ "$(echo "$percent" | awk -F% '{print $1}')" -lt 5 ]; then +if [ -n "$remaining" ] && [ "$(echo "$percent" | awk -F% '{print $1}')" -lt 5 ]; then notify-send "CHARGE YOUR BATTERY" fi