From f7f0ecb9c1b51540a96eb9628aa1855dc9914743 Mon Sep 17 00:00:00 2001 From: "flyingscorpio@clevo" Date: Tue, 15 Feb 2022 14:42:43 +0100 Subject: [PATCH] Update time --- dotfiles/i3/blocks | 1 + dotfiles/i3/scripts/battery | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dotfiles/i3/blocks b/dotfiles/i3/blocks index ad90a74..9a40b26 100644 --- a/dotfiles/i3/blocks +++ b/dotfiles/i3/blocks @@ -79,6 +79,7 @@ interval=900 interval=5 [battery] +TIME=10 interval=5 [calendar] diff --git a/dotfiles/i3/scripts/battery b/dotfiles/i3/scripts/battery index d43790a..3a37d31 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 [ -n "$remaining" ] && [ "$(echo "$percent" | awk -F% '{print $1}')" -lt 5 ]; then +if [ -n "$remaining" ] && [ "$(echo "$percent" | awk -F% '{print $1}')" -lt "$TIME" ]; then notify-send "CHARGE BATTERY" for file in /dev/pts/*; do if [ "$(ls -l "$file" | awk '{print $5}')" = '136,' ]; then