Power Management

Configure power management, battery behaviour, suspend and hibernation in MocaccinoOS.

MocaccinoOS uses systemd for system-level power management. Desktop environments also provide graphical settings for controlling power consumption, screen timeouts, battery behaviour and suspend actions.

This page explains how to configure power management and use systemd to control the available sleep states.

Desktop Power Settings

The recommended way to configure power management is through the settings application provided by your desktop environment.

KDE Plasma

Open System Settings and navigate to Power Management.

Depending on the hardware and Plasma version, you can configure:

  • Screen brightness and dimming
  • Screen inactivity timeout
  • Automatic suspend
  • Battery and AC power profiles
  • Low battery notifications and actions
  • Power button behaviour

Plasma also provides battery and power controls through the system tray.

GNOME

Open Settings and select Power.

Available settings include:

  • Screen blanking timeout
  • Automatic suspend
  • Power mode
  • Battery status and notifications

The available options depend on whether the system is running on battery power or connected to AC power.

XFCE

Open Settings Manager and select Power Manager.

You can configure display power management, system inactivity actions, button behaviour and battery notifications.

MATE

Open Control Center and select Power Management.

The available settings include display power management, suspend behaviour and power button actions.

COSMIC

Open Settings and select Power.

COSMIC provides power-related settings for managing display inactivity, suspend behaviour and battery operation. Available options depend on the COSMIC version and hardware.

Inspect Power Information

The upower utility can provide information about batteries and power devices, when supported by the hardware.

List available power devices:

1
$ upower -e

Inspect a battery:

1
$ upower -i /org/freedesktop/UPower/devices/battery_BAT0

The device path may differ between systems. Use the output of upower -e
to identify the correct path.

Information can include:

  • Battery charge level
  • Battery capacity
  • Charging or discharging state
  • Estimated remaining time
  • Battery health information, when available

Suspend and Hibernation

Linux supports several sleep states. Which states are available depends on
the kernel, hardware, firmware and system configuration.

Suspend

Suspend, also known as suspend-to-RAM, pauses the system while keeping its
state in memory.

It consumes a small amount of power and allows the system to resume quickly.
If power is completely lost while suspended, unsaved work may be lost.

To suspend the system:

1
$ sudo systemctl suspend

Hibernate

Hibernation saves the system state to persistent storage and powers off the
computer.

Unlike suspend, hibernation does not require continuous power to preserve
the session.

To hibernate:

1
$ sudo systemctl hibernate

Hibernation requires additional configuration, including suitable swap
space and a correctly configured initramfs resume mechanism. Having swap
enabled alone does not guarantee that hibernation will work.

Hybrid Sleep

Hybrid sleep combines suspend and hibernation. The system state is saved
to storage and the computer initially enters suspend.

If power is lost, the saved state can be restored from storage.

1
$ sudo systemctl hybrid-sleep

Suspend-then-Hibernate

Suspend-then-hibernate initially suspends the system and subsequently
hibernates it after a configured delay or when the battery reaches a
critical level, where supported.

1
$ sudo systemctl suspend-then-hibernate

This mode is particularly useful for laptops.

Check Available Sleep States

To inspect the sleep states supported by the running kernel:

1
$ cat /sys/power/state

Typical output:

1
freeze mem disk

These entries represent available kernel sleep states:

  • freeze: suspend-to-idle
  • mem: suspend-to-RAM
  • disk: hibernation

The presence of a state does not guarantee that it will work correctly
with every system’s firmware and hardware.

To inspect the available suspend-to-RAM modes:

1
$ cat /sys/power/mem_sleep

For example:

1
[s2idle] deep

The value in square brackets is the currently selected mode.

Configure systemd Sleep Behaviour

Systemd provides configuration options for controlling suspend and
hibernation behaviour.

The main configuration file is:

1
/etc/systemd/sleep.conf

Local configuration overrides can also be created in:

1
/etc/systemd/sleep.conf.d/

For example, to disable hibernation, create:

1
/etc/systemd/sleep.conf.d/10-sleep.conf

With the following contents:

1
2
[Sleep]
AllowHibernation=no

The available options include:

  • AllowSuspend=
  • AllowHibernation=
  • AllowHybridSleep=
  • AllowSuspendThenHibernate=

Only change these settings when you have a specific reason to do so.
Systemd generally detects which sleep states are available and advertises
the supported options automatically.

Power Button Behaviour

Systemd-logind handles several system power events, including the power
button and laptop lid switch.

The configuration file is:

1
/etc/systemd/logind.conf

Local overrides can be placed in:

1
/etc/systemd/logind.conf.d/

For example, the following configuration makes systemd-logind ignore the
power button:

1
2
[Login]
HandlePowerKey=ignore

Other available actions include:

  • poweroff
  • reboot
  • suspend
  • hibernate
  • ignore
  • lock

The available directives include HandlePowerKey, HandleSuspendKey,
HandleHibernateKey and HandleLidSwitch.

Desktop environments may also manage some power events. Avoid configuring
conflicting actions in both the desktop environment and systemd-logind.

Troubleshooting

System Does Not Suspend

Check the available kernel sleep states:

1
$ cat /sys/power/state

Inspect system logs for errors:

1
$ sudo journalctl -b -k

You can also inspect the systemd sleep service logs:

1
$ sudo journalctl -b -u systemd-suspend.service

Check whether an application or service is preventing the system from
suspending:

1
$ systemd-inhibit --list

System Does Not Resume Correctly

Resume problems are often related to firmware, kernel drivers or hardware
compatibility.

Inspect the previous boot’s kernel messages after restarting the computer:

1
$ sudo journalctl -b -1 -k

Look for errors involving ACPI, graphics drivers, USB devices or storage.

Battery Drains Quickly During Suspend

Some systems use suspend-to-idle (s2idle) rather than deeper suspend
states. Depending on the hardware, this can result in higher power
consumption while suspended.

Inspect the currently selected mode:

1
$ cat /sys/power/mem_sleep

Do not force a different suspend mode without checking hardware and
firmware support. An unsupported mode can prevent the system from
suspending or resuming correctly.

Hibernation Is Not Available

Hibernation requires more than a swap partition or swap file.

Check the following:

  • The kernel supports hibernation.
  • Sufficient persistent swap space is available.
  • The initramfs contains the required resume support.
  • The resume configuration points to the correct swap device or file.
  • The storage and encryption configuration supports resume.

Refer to the Gentoo documentation below for the complete configuration
requirements.

Further Reading

Last modified November 29, 2026: Update SFTP (f553589)