Power management - ArchWiki
(Redirected from Power saving ) Related articles /Suspend and hibernate /Wakeup triggers CPU frequency scaling Display Power Management Signaling Hybrid graphics sysctl Power management is a feature that turns off the power or switches system components to a low-power state when inactive. In Arch Linux, power management consists of two main parts: Configuration of the Linux kernel , which interacts with the hardware: Kernel parameters Kernel modules udev rules Configuration of userspace tools, which interact with the kernel and react to its events.
Many userspace tools also allow modification of kernel configuration in a "user-friendly" way. See #Userspace tools for the options. Userspace tools These tools allow you to change a lot of settings without the need to edit config files by hand. Only run one of these tools to avoid possible conflicts as they all work more or less similarly. Have a look at the power management category to get an overview on what power management options exist in Arch Linux.
These are the more popular scripts and tools designed to help power saving: Console acpid — A daemon for delivering ACPI power management events with netlink support. https://sourceforge.net/projects/acpid2/ || acpid Laptop Mode Tools — Utility to configure laptop power saving settings, considered by many to be the de facto utility for power saving though may take a bit of configuration. https://github.com/rickysarraf/laptop-mode-tools || laptop-mode-tools AUR libsmbios — Library and tools for interacting with Dell SMBIOS tables. https://github.com/dell/libsmbios || libsmbios power-profiles-daemon — Makes power profiles handling available over D-Bus. https://gitlab.freedesktop.org/upower/power-profiles-daemon || power-profiles-daemon powerstat — A tool that measures power consumption using the ACPI or Intel RAPL interface. https://github.com/ColinIanKing/powerstat || powerstat AUR powertop — A tool to diagnose issues with power consumption and power management to help set power saving settings. https://github.com/fenrus75/powertop || powertop systemd — A system and service manager. https://systemd.io/ || systemd TLP — Advanced power management for Linux. https://linrunner.de/tlp || tlp TuneD — Daemon that performs monitoring and adaptive configuration of devices in the system. https://tuned-project.org || tuned UPower — Abstraction for enumerating power devices, listening to device events and querying history and statistics. https://upower.freedesktop.org || upower Graphical batsignal — Lightweight battery monitor that uses libnotify to warn of low battery levels. https://github.com/electrickite/batsignal || batsignal cbatticon — Lightweight and fast battery icon that sits in your system tray. https://github.com/valr/cbatticon || cbatticon GNOME Power Statistics — System power information and statistics for GNOME. https://gitlab.gnome.org/GNOME/gnome-power-manager || gnome-power-manager KDE Power Devil — Power management module for Plasma. https://invent.kde.org/plasma/powerdevil || powerdevil LXQt Power Management — Power management module for LXQt. https://github.com/lxqt/lxqt-powermanagement || lxqt-powermanagement MATE Power Management — Power management tool for MATE. https://github.com/mate-desktop/mate-power-manager || mate-power-manager MATE Power Statistics — System power information and statistics for MATE. https://github.com/mate-desktop/mate-power-manager || mate-power-manager poweralertd — Daemon for delivering UPower notifications. https://git.sr.ht/~kennylevinsen/poweralertd || poweralertd AUR powerkit — Desktop independent power manager. https://github.com/rodlie/powerkit || powerkit AUR vattery — Battery monitoring application written in Vala that will display the status of a laptop battery in a system tray. https://www.jezra.net/projects/vattery.html || vattery AUR Wattage — Application designed for monitoring the health and status of your power devices. https://github.com/v81d/wattage || wattage AUR Xfce Power Manager — Power manager for Xfce. https://docs.xfce.org/xfce/xfce4-power-manager/start || xfce4-power-manager ACPI events systemd handles some power-related ACPI events, whose actions can be configured in /etc/systemd/logind.conf or /etc/systemd/logind.conf.d/*.conf — see logind.conf(5) .
On systems with no dedicated power manager, this may replace the acpid daemon which is usually used to react to these ACPI events. The specified action for each event can be one of ignore , poweroff , reboot , halt , suspend , hibernate , hybrid-sleep , suspend-then-hibernate , lock or kexec . In case of hibernation and suspension, they must be properly set up . If an event is not configured, systemd will use a default action.
Event handler Description Default action HandlePowerKey Triggered when the power key/button is pressed. poweroff HandlePowerKeyLongPress Triggered when the power key/button is held ignore HandleRebootKey Triggered when the reboot key/button is pressed reboot HandleRebootKeyLongPress Triggered when the Reboot key/button is held poweroff HandleSuspendKey Triggered when the suspend key/button is pressed. suspend HandleSuspendKeyLongPress Triggered when the suspend key/button is held hibernate HandleHibernateKey Triggered when the hibernate key/button is pressed. hibernate HandleHibernateKeyLongPress Triggered when the hibernate key/button is held ignore HandleLidSwitch Triggered when the lid is closed, except in the cases below. suspend HandleLidSwitchDocked Triggered when the lid is closed if the system is inserted in a docking station, or more than one display is connected. ignore HandleLidSwitchExternalPower Triggered when the lid is closed if the system is connected to external power. action set for HandleLidSwitch To apply changes, reload systemd-logind.service .
Note systemd cannot handle AC and Battery ACPI events, so if you use Laptop Mode Tools or other similar tools acpid is still required. When performing lid switches in short succession, logind will delay the suspend action for up to 90s to detect possible docks. [1] You can use HoldoffTimeoutSec= in logind.conf(5) to configure the delay. Power managers Some desktop environments include power managers which inhibit (temporarily turn off) some or all of the systemd ACPI settings.
If such a power manager is running, then the actions for ACPI events can be configured in the power manager alone. Changes to /etc/systemd/logind.conf or /etc/systemd/logind.conf.d/*.conf need be made only if you wish to configure behaviour for a particular event that is not inhibited by the power manager. Note that if the power manager does not inhibit systemd for the appropriate events you can end up with a situation where systemd suspends your system and then when the system is woken up the other power manager suspends it again.
The power managers of GNOME , MATE , Plasma and Xfce issue the necessary inhibited commands. If the inhibited commands are not being issued, such as when using acpid or others to handle ACPI events, set the Handle options to ignore . See also systemd-inhibit(1) . xss-lock xss-lock subscribes to the systemd-events suspend , hibernate , lock-session , and unlock-session with appropriate actions (run locker and wait for user to unlock or kill locker). xss-lock also reacts to DPMS events and runs or kills the locker in response.
Autostarting the following for example: $ xss-lock -- i3lock -n -i background_image.png & Power saving Note See Laptop#Power management for power management specific to laptops, such as battery monitoring. See also pages specific to your CPU and GPU (e.g., Ryzen , AMDGPU ). This section is a reference for creating custom scripts and power saving settings such as by udev rules. Make sure that the settings are not managed by some other utility to avoid conflicts.
Almost all of the features listed here are worth using whether or not the computer is on AC or battery power. Most have negligible perf
The rest of this page is on the live site.