Originally Posted by allend
The battery percentage charge is likely to be found in /sys/class/power_supply/BAT0/capacity.
Popup messages can be created using 'xmessage'.
Sounds can be played using 'aplay'.
Regular checks can be scheduled using 'cron'.
i.e. Write a script that can be run as a cron job.
Tried to do it in python, can someone please comment where is my error ?
Python 3.4.0 (default, Apr 11 2014, 13:05:18)
[GCC 4.8.2] on linux
Type "copyright", "credits" or "license()" for more information.
>>> fh = open("/sys/class/power_supply/BAT0/capacity", "r")
>>> lines = [ i.rstrip() for i in fh.readlines()]
>>> print lines
SyntaxError: invalid syntax