Linux battery status1/29/2024 ![]() You should anyhow first have a look to the documentation regarding the Linux Power Supply Class. So just browse into that directory or use possibly more convenient cli tools such as upower or acpi. upowerd appears to recreate the data files after about ten minutes post-deletion, so perhaps these are required to store data points over a longer period of time.In Linux, everything related to batteries can be found under the /sys/class/power_supply directory tree. Running "upower -d" also outputs history points for charge and discharge rate when the data files don't exist, so presumably it can also access the same data source that is independent of the /var/lib/upower history files. I assume that something other than upower must have a short-term log of this data, which is what was being displayed in gnome-power-statistics. Strangely enough, it was showing a couple of minutes of battery history from since the reboot without anything having recreated the /var/lib/upower data files, and I couldn't find anywhere else in the filesystem where it could have been storing the data (there were no file descriptors for upowerd or gnome-power-statistics pointing to anywhere on the filesystem, just kernel sockets). Initially, after deleting /var/lib/upower/*.dat, gnome-power-statistics just ran as a blank GUI window with no content, but returned to its usual self after the reboot. I assumed that since upowerd was still running, these files would be automatically regenerated, but they weren't – nor were they there immediately after rebooting. If they exist, you might get some more attention for your question by people who know gnome-power-manager better if you add some more specific tags, ie. I suppose it's also possible that ACPI might store the history information somewhere as well, although once again there doesn't seem to be any documentation for this. It's possible that rather than storing it in it's own file it is using some larger database that gnome uses for a variety of settings. It looks like most of the information it reads about the battery comes from acpi via /proc/acpi/battery/BAT0/info (my path is "BAT0" yours might be different from yours) For example, here's mine: present: yesīut other than cycle count and last full capacity there isn't a lot of history information here, so there must be another file somewhere that gnome-power-manager is using for the history information. ![]() One would think that gnome-power-manager would have it's own log file somewhere for storing it-I can't find anything of the sort however. I'd say back up these files, then either delete them or delete their contents and you should be good to go! Let me know how it works. These four files, despite being ".dat" files are really just human readable text documents with the history. Your file names will obviously be different but they should be in the same directory ( /var/lib/upower/)regardless. var/lib/upower/history-rate-DELL_KP096.dat var/lib/upower/history-time-full-DELL_KP096.dat var/lib/upower/history-time-empty-DELL_KP096.dat I searched through my filesystem and my database names are. ![]() After looking through the source for UPower it looks like the persistent database where the history is stored is defined as history-%s-%s.dat. Edit: Ubuntu now uses freedesktop's UPower power-manager.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |