File: battery.el.html

There is at present support for GNU/Linux, BSD, macOS, and Windows.

This library supports:
- UPower (https://upower.freedesktop.org) via D-Bus API.
- The /sys/class/power_supply/ files of Linux >= 2.6.39.
- The /proc/acpi/ directory structure of Linux 2.4.20 and 2.6.
- The /proc/apm file format of Linux version 1.3.58 or newer.
- The Haiku ACPI battery driver.
- BSD by using the apm program.
- Darwin (macOS) by using the pmset program.
- Windows via the GetSystemPowerStatus API call.
- Android via the BatteryManager APIs.

Defined variables (21)

battery--upower-signalsHandles for UPower signal subscriptions.
battery-echo-area-formatControl string formatting the string to display in the echo area.
battery-linux-proc-apm-regexpRegular expression matching contents of ‘/proc/apm’.
battery-load-criticalUpper bound of critical battery load percentage.
battery-load-lowUpper bound of low battery load percentage.
battery-mode-line-formatControl string formatting the string to display in the mode line.
battery-mode-line-limitPercentage of full battery load below which display battery status.
battery-mode-line-stringString to display in the mode line.
battery-status-functionFunction for getting battery status information.
battery-update-functionsFunctions run by ‘display-battery-mode’ after updating the status.
battery-update-intervalSeconds after which the battery status will be updated.
battery-update-timerInterval timer object.
battery-upower-devicePreferred UPower device name(s).
battery-upower-device-interfaceName of the UPower Device D-Bus interface.
battery-upower-device-pathD-Bus object providing ‘battery-upower-device-interface’.
battery-upower-interfaceName of the UPower D-Bus interface.
battery-upower-pathD-Bus object providing ‘battery-upower-interface’.
battery-upower-serviceWell-known name of the UPower D-Bus service.
battery-upower-subscribeWhether to subscribe to UPower device change signals.
display-battery-modeNon-nil if Display-Battery mode is enabled.
display-battery-mode-hookHook run after entering or leaving ‘display-battery-mode’.

Defined functions (24)

battery()
battery--call-process-to-string(PROGRAM &rest ARGS)
battery--files(DIR)
battery--find-linux-sysfs-batteries()
battery--search-haiku-acpi-status()
battery--upower-device-properties(DEVICE)
battery--upower-devices()
battery--upower-props-changed(INTERFACE CHANGED INVALIDATED)
battery--upower-signal-handler(&rest _)
battery--upower-state(PROPS STATE)
battery--upower-subscribe()
battery--upower-unsubscribe()
battery-android()
battery-bsd-apm()
battery-format(FORMAT ALIST)
battery-haiku-acpi-battery()
battery-linux-proc-acpi()
battery-linux-proc-apm()
battery-linux-sysfs()
battery-pmset()
battery-search-for-one-match-in-files(FILES REGEXP MATCH-NUM)
battery-update()
battery-upower()
display-battery-mode(&optional ARG)

Defined faces (2)

battery-load-criticalFace used in mode line string when battery load is critical. See the option ‘battery-load-critical’.
battery-load-lowFace used in mode line string when battery load is low. See the option ‘battery-load-low’.