![]() ![]() You can always obtain some basic information by parsing individual files in the /sys/class/power_supply/ directory. The other possible messages are Discharging and Fully charged. In this case, the command reveals that BAT0 is charging. BAT0/status file, which shows the status of BAT0. The following command in Figure 1: cat /sys/class/power_supply/BAT0/status The device has two batteries, one built-in and one replaceable, so the first command in Figure 1 reveals three power supplies: AC power, as well as the first and second batteries ( BAT0 and BAT1).įigure 1: Using the sysfs pseudo filesystem, you can determine the available power supplies and discover detailed information on the power components. Checking on Powerįigure 1 shows power data for a Lenovo ThinkPad X 250 running Debian 8. The developers have now reorganized the filesystem and have moved the information to /sys/class/power_supply/. Up to Linux 2.6.26, ACPI information was found on the proc filesystem below /proc/acpi/. ![]() For Debian and its derivatives, you'll need the acpi, acpid, and acpi-support-base packages. ![]() Linux comes with some command-line tools that let you read information on battery status and health. )ĪCPI used to be a separate component in Linux, but the Linux kernel developers now maintain ACPI functionality within the framework of the Unified Extensible Firmware Interface (UEFI). (For more information on APM and ACPI check out TuxMobil and the ACPI how-to. ACPI, which first appeared in 1996, has now replaced its predecessor, Advanced Power Management (APM) the current version 6 dates from April 2015. The data for the warning message come from the Advanced Configuration and Power Interface (ACPI). Eventually, however, you will see a message informing you that the charge has reached a minimum threshold, and you have to save your data quickly or else switch to mains mode to continue working while the battery charges in the background. Hsphfpd reports battery status (and other stuff) through DBus, so to get it from the command line, you can just do dbus-send -system -dest=org.hsphfpd -print-reply /org/hsphfpd/hci0/dev_XX_XX_XX_XX_XX_XX/hsp_hs .Get string: string:BatteryLevelīoth of these are available in the AUR, if you use Arch Linux.The quality of life for any laptop owner depends on the battery maintaining enough charge to operate off the power grid. Even though these are both still prototypes, they seem to work very well. There is a version of PulseAudio patched to use hsphfpd. That way, PulseAudio and whatever can both use the headset at the same time. Hsphfpd is specification with some prototype implementation used for connectingīluetooth devices with HSP and HFP profiles on Linux operating system.īasically, since only one program can communicate with the headset at once and it wouldn't make sense to implement battery level reporting in an audio server, nor implement audio in a power management software, it moves that functionality to an external daemon. Only one program can open a socket to talk to the bluetooth device, so it ends up fighting with PulseAudio over it. If I understand the problem correctly, that happens because I'd been using the Python program from clst's answer for some time and although it worked, it required me to connect, then disconnect and run it again. (This answer is specific to headphones/headsets) ![]()
0 Comments
Leave a Reply. |