diff --git a/dotfiles/i3/blocks b/dotfiles/i3/blocks index 9a40b26..029ee7e 100644 --- a/dotfiles/i3/blocks +++ b/dotfiles/i3/blocks @@ -79,7 +79,7 @@ interval=900 interval=5 [battery] -TIME=10 +THRESHOLD=10 interval=5 [calendar] diff --git a/dotfiles/i3/scripts/battery b/dotfiles/i3/scripts/battery index 3a37d31..6583423 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 "$TIME" ]; then +if [ -n "$remaining" ] && [ "$(echo "$percent" | awk -F% '{print $1}')" -lt "$THRESHOLD" ]; then notify-send "CHARGE BATTERY" for file in /dev/pts/*; do if [ "$(ls -l "$file" | awk '{print $5}')" = '136,' ]; then