Просмотр исходного кода

~/.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
Родитель
Сommit
b987d6ea16
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      .bin/warn-if-low.sh

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

@ -9,6 +9,6 @@ charge_rate=$(($charge_now * 100 / $charge_full ))
9 9
10 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 13
	DISPLAY=:0 zenity --error --text "Whoopey: You're low on energy (only $charge_rate% left)!"
14 14
fi