all repos

dotfiles @ 52fd2af843e35948862ee50e8d14f8ca5ee1eb47

my dotfiles

config/hypr/bat.sh (view raw)

1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env bash

# the purpose of the script is to notify when battery percentage is low

while true; do
  if [[ "$(cat /sys/class/power_supply/BAT0/capacity)" -le 30 ]]; then
    notify-send --urgency=CRITICAL "Battery Low" "Consider plugging cable in"
    sleep 1200
  else
    sleep 120
  fi
done