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