Parcourir la Source

~/.bin/warn-if-low.sh: Warn at lower level.

My current main computer has a better battery so warning me 20 minutes
prior to actually going down is just annoying. So, here is the future!

Thinking about this, I could probably detect this... There should be a
discharge rate or something like that. Ok, as it turns out there is
`/sys/class/power_supply/BAT0/{alarm,capacity}` where `alarm` could be
the "critical" threshold and capacity could be the current percentage.
Laters, I think.

Bye. :)

(I like these mini-posts, further announcements in a future log post.)
Lucas Stadler 12 ans auparavant
Parent
commit
b987d6ea16
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      .bin/warn-if-low.sh

+ 1 - 1
.bin/warn-if-low.sh

9
9
10
online=`cat $charge_path/AC/online`
10
online=`cat $charge_path/AC/online`
11
11
12
if [ "$online" = "0" -a $charge_rate -lt 10 ]; then
12
if [ "$online" = "0" -a $charge_rate -lt 5 ]; then
13
	DISPLAY=:0 zenity --error --text "Whoopey: You're low on energy (only $charge_rate% left)!"
13
	DISPLAY=:0 zenity --error --text "Whoopey: You're low on energy (only $charge_rate% left)!"
14
fi
14
fi