blob: a599409b29fb835cb5533283ce5b3c05183f7f3a (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
#! /bin/sh
PERCENT0=$(cat /sys/class/power_supply/BAT0/capacity)
PERCENT1=$(cat /sys/class/power_supply/BAT1/capacity)
PERCENT=$(( ($PERCENT0 + $PERCENT1) / 2))
CHARGING0=$(cat /sys/class/power_supply/BAT0/status)
CHARGING1=$(cat /sys/class/power_supply/BAT1/status)
[[ "$CHARGING0" == "Charging" || "$CHARGING1" == "Charging" ]] && exit;
[ "$PERCENT" -le 15 ] && notify-send "Brrr" "<15% | Low Bat"
|