Generated by GPT-5-mini| UPower | |
|---|---|
| Name | UPower |
| Developer | Freedesktop.org |
| Written in | C; GLib |
| Operating system | Linux-based systems |
| License | GNU Lesser General Public License |
UPower UPower is a system service for managing power sources and battery information on Linux-based systems. It provides an abstracted daemon, client utilities, and an API that enables applications and desktop environments to query power status, receive notifications, and perform power-related actions. UPower acts as a bridge between hardware-level power subsystems such as ACPI, PMICs, and higher-level software such as systemd, GNOME, and KDE.
UPower implements a standardized interface for enumerating batteries, line power, and power adapters on systems using ACPI or platform-specific power management firmware. It exposes device properties and events over the D-Bus interprocess communication system, allowing privileged services like logind in systemd and user-facing applications like GNOME Power Manager and KDE Powerdevil to react to changes. The project is hosted under Freedesktop.org and references conventions from udev, HAL, and other legacy tools while coordinating with modern init systems such as systemd and session managers including GNOME Shell and KWin.
UPower is composed of a daemon process that enumerates power devices, a library providing a client API, command-line utilities, and D-Bus interfaces. The daemon interrogates kernel interfaces provided by Linux kernel subsystems — notably ACPI and power supply class drivers — as well as platform-specific interfaces on laptops from vendors like Intel and AMD. It registers device objects on the D-Bus message bus and emits signals for property changes and events. The client library, implemented with GLib conventions, offers synchronous and asynchronous calls and integrates with event loops used by toolkits like GTK and Qt. UPower cooperates with session and system services such as systemd-logind for policy decisions and with hardware abstraction layers like udev for device naming and hotplugging.
UPower provides battery percentage, charge/discharge rates, time to empty/full estimates, and state descriptors such as charging, discharging, or fully charged. It supports multiple battery configurations, including hot-swappable batteries found in workstation and server platforms as well as embedded devices. UPower emits notifications for events like low battery, critical battery, and resume/suspend transitions; these notifications can be consumed by desktop components such as GNOME Shell, KDE Plasma, Xfce, and session daemons. The service also exposes power adapter characteristics, battery health metrics, and vendor-specific attributes for hardware from manufacturers like Dell, Lenovo, and HP. Utilities included in the project let administrators inspect device status and simulate events for testing with tools commonly used by distributions such as Debian, Ubuntu, Fedora, and Arch Linux.
UPower configuration typically resides in system-wide files maintained by distributions and is influenced by policies from systemd and distribution-specific power management packages. Administrators can adjust thresholds for low and critical battery warnings, define behavior for lid events on laptops, and set rules for hibernation and suspend actions; these settings interact with power management components like systemd-sleep and pm-utils. Desktop sessions override or complement system defaults through per-user settings managed by environments such as GNOME and KDE. Distribution vendors including Canonical, Red Hat, and SUSE may ship patches and default configurations tailored for hardware certification programs like Ubuntu Certified and Red Hat Hardware Certification.
UPower integrates with major desktop environments by providing a consistent D-Bus interface consumed by power applets, notification daemons, and settings panels. GNOME uses UPower to populate status indicators in GNOME Shell and to drive automatic suspend and hibernate policies; KDE Plasma consumes the same signals via KDE Frameworks components such as PowerDevil. Lightweight environments like Xfce and LXDE also interact with UPower through component libraries and utilities. Application toolkits including GTK and Qt provide bindings to the GLib-based client library so third-party applications like Firefox, LibreOffice, and VLC media player can adapt behavior based on battery state. Integration also extends to display servers and compositors like X.Org and Wayland compositors where session managers may inhibit sleep during media playback for applications such as MPV and GStreamer-based players.
UPower evolved from earlier efforts such as the Hardware Abstraction Layer (HAL) and the DeviceKit-power project, consolidating power-management functionality under a unified daemon managed by Freedesktop.org. Key maintainers and contributors have included developers active in projects like GNOME and distribution engineering teams from Debian and Fedora. Over time, the codebase has adopted modern GLib idioms, improved D-Bus APIs, and coordinated with systemd maintainers to ensure correct session and system interactions. Release management has aligned with distribution cycles from vendors such as Debian, Ubuntu, and Fedora while community contributions address hardware support for platforms from Intel, ARM-based vendors, and laptop manufacturers.
UPower runs as a system service exposing device properties over the system D-Bus; access control and policy considerations are therefore important. Distributions employ D-Bus policy files and polkit rules to restrict which users or processes can perform privileged actions like inhibiting suspend or forcing hibernate. Information exposed by UPower includes battery presence and vendor identifiers, which may leak hardware model details relevant to privacy-sensitive scenarios; desktop environments and packaging maintainers must consider minimization and consent for telemetry used in bug reports or diagnostics. Integration with secure boot chains and kernel-level power management ensures that malicious userland code cannot trivially manipulate firmware-level power operations without appropriate privileges, a model consistent with security practices in projects like systemd and polkit.
Category:Power management software