Skip to content
Advertisement

Use Python to Access Battery Status in Ubuntu

I am trying to come out with a small python script to monitor the battery state of my ubuntu laptop and sound alerts if it’s not charging as well as do other stuff (such as suspend etc). I really don’t know where to start, and would like to know if there is any library for python i can use. Any help would be greatly appreciated. Thanks

Advertisement

Answer

I believe you can find the information you are looking for in

/sys/class/power_supply/BAT0
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement