Dotfiles for i3-wm, zsh, polybar, neomutt etc.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

13 lines
371 B

#!/bin/bash
bat_percent=$(acpi -b| grep -P -o '[0-9]+(?=%)')
bat_status=$(acpi -b| grep -c 'Charging')
bat_full=$(acpi -b | grep -c "Full")
if [ $bat_status -eq 0 -a $bat_percent -le 15 ]; then
exec /usr/bin/notify-send -u critical -t 10000 "Low Battery, Please Charge"
fi
if [ $bat_full -eq 1 -a $bat_percent -eq 100 ]; then
exec notify-send "Full Charge"
fi