Chapter 11. Changing system power settings


You can configure the power settings of your system to manage energy consumption and optimize performance. Changing the system power settings enables you to balance between energy conservation and performance.

11.1. Changing the power button behavior

To customize the action of the power button, you can change its default behavior both when GNOME is running and when it is not running.

To prevent the system from shutting down when you press the power button, you need to modify settings for the non-graphical systemd target. Select the option according to requirement.

Prerequisites

  • You have administrative privileges.

Procedure

  1. Edit the /etc/systemd/logind.conf configuration file to set the HandlePowerKey variable.
  2. To reboot the system when you press the power button, set the reboot value:

    HandlePowerKey=reboot

    Use one of the following options:

    • poweroff: Shut down the computer.
    • reboot: Reboot the system.
    • halt: Initiate a system halt.
    • kexec: Initiate a kexec reboot.
    • suspend: Suspend the system.
    • hibernate: Initiate system hibernation.
    • ignore: Do nothing.
  3. Restart the systemd-logind service to apply the changes:

    # systemctl reload systemd-logind

To prevent the system from suspending when you press the power button, modify settings for the GNOME login screen and user session. You can select one of the options: physically on a system or virtually from a remote console.

Prerequisites

  • You have administrative privileges.

Procedure

  1. Create a local database for system-wide settings in the /etc/dconf/db/local.d/01-power file:

    [org/gnome/settings-daemon/plugins/power]
    power-button-action=<value>

    Replace <value> with one of the following power button actions:

    • nothing: Does nothing.
    • suspend: Suspends the system.
    • hibernate: Hibernates the system.
    • interactive: Shows a pop-up query asking the user what to do.

      In the interactive mode, when you press the power button, the system automatically powers off after 60 seconds. You can select a different behavior from the pop-up query.

  2. Optional: To override existing settings and prevent other users from changing it, edit configuration in the /etc/dconf/db/local.d/locks/01-power file:

    /org/gnome/settings-daemon/plugins/power/power-button-action
  3. Update the system databases:

    # dconf update
  4. Log out and log in again for the system-wide settings to take effect.

Verification

  • Press the power button and check if the system performs the action you configured.

When you close the lid of your laptop, it suspends by default to save battery. You can customize this behavior according to your preferences.

Warning

Some laptops can overheat if they are left running with the lid closed, especially in confined spaces. Consider whether changing this setting is safe for your laptop, especially if you intend to keep the laptop running with the lid closed for extended periods of time.

Prerequisites

  • Administrative access

Procedure

  1. Open the /etc/systemd/logind.conf configuration file.
  2. Look for the line that says HandleLidSwitch=suspend.
  3. If the line starts with the # symbol, remove it to enable the setting.
  4. Replace suspend with one of the following options:

    • poweroff to shut down the computer.
    • lock to lock the screen.
    • ignore to do nothing.

    For example, to lock the screen upon closing the lid, use this setting:

    HandleLidSwitch=lock
  5. Save your changes and close the editor.
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top