upower
Show power management information
TLDR
Display power and battery information
List all power devices
Watch for and print power status changes
Watch for and print detailed power status changes
Display version
SYNOPSIS
upower [OPTIONS...]
Common operations:
upower --dump
upower --enumerate
upower --show-info=OBJECT_PATH
upower --monitor
upower --wakeups
PARAMETERS
--dump, -d
Dumps all known power device properties and their current values. This provides a comprehensive overview of the system's power state.
--enumerate, -e
Enumerates all currently available power devices by listing their D-Bus object paths. These paths are used with --show-info.
--show-info=OBJECT_PATH, -i OBJECT_PATH
Shows detailed information for a specific power device, identified by its OBJECT_PATH obtained from --enumerate.
--monitor, -m
Monitors the UPower service for real-time changes to power devices or events (e.g., battery charge level changes, AC adapter connection/disconnection). This command runs continuously until interrupted.
--wakeups, -w
Shows information about devices or events that can wake up the system from a suspended state, providing insights into system activity during sleep.
--verbose
Increases the verbosity of the output, showing more detailed debug information which can be useful for diagnostics.
--version
Displays the version of the upower command and exits.
--help
Displays a brief help message with available options and exits.
DESCRIPTION
The upower command is the command-line interface for the UPower system service on Linux. UPower provides a centralized way to enumerate power devices, get information about them, and receive notifications about power-related events.
Using upower, users can inspect the status of their laptop batteries, AC adapters, uninterruptible power supplies (UPS), and other power sources. It offers details such as charge level, charging/discharging status, estimated time remaining, and battery health.
While UPower itself is a D-Bus service that handles various aspects of power management (e.g., sending low-battery warnings, interacting with system suspend), the upower command primarily acts as a diagnostic and informational tool. It allows administrators and users to query the state of power devices and monitor changes in real-time, which is crucial for troubleshooting power issues or scripting power-aware applications.
CAVEATS
The upower command relies on the UPower system service being active and running. Its primary function is to report and monitor power device status; direct system power state changes (like suspend or hibernate) are typically handled by other system services such as systemd-logind, which UPower interacts with via D-Bus. Information accuracy depends on underlying kernel drivers and proper hardware support.
D-BUS INTEGRATION
UPower operates as a D-Bus system service, meaning that applications and other system components interact with it by sending and receiving messages over the D-Bus message bus. The upower command-line tool is essentially a client that communicates with this service, translating command-line arguments into D-Bus calls and displaying the service's responses. This architecture ensures system-wide consistency in power management.
DESKTOP ENVIRONMENT INTERACTION
UPower is crucial for desktop environments to provide graphical battery indicators, low-power warnings, and integrated power management settings. It allows the desktop to accurately reflect current power conditions, react to events like connecting or disconnecting the AC adapter, and initiate power-saving actions based on battery levels or user preferences.
HISTORY
UPower emerged as a modern power management solution for Linux, replacing and consolidating functionalities previously handled by the legacy HAL (Hardware Abstraction Layer) and parts of pm-utils. Its development aimed to provide a robust, D-Bus-centric interface for power device information and events, tightly integrated with modern desktop environments like GNOME and KDE. It became a standard component in most contemporary Linux distributions for managing battery status, AC adapter presence, and other power-related features, leading to the deprecation of older, less integrated tools for these specific tasks.
SEE ALSO
acpi(1), pm-powersave(8), systemctl(1), dbus-send(1), udevadm(8)