Ce contenu n'est pas disponible dans la langue sélectionnée.

13.11. Changing Behavior when Pressing the Power Button in Graphical Target Mode


When the machine is booted to a graphical login screen or user session, hitting the power button makes the machine suspend by default. This happens both in cases when the user presses the power button physically or when pressing a virtual power button from a remote console. To achieve a different behavior when pressing the power button, set the function of this button with dconf.
For example, if you want the system to shutdown after pressing the power button, use the following procedure:

Procedure 13.11. Using dconf to configure the system to shutdown after pressing the power button

  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='interactive'
    
    Copy to Clipboard Toggle word wrap
  2. Override the user's setting and prevent the user from changing it in the /etc/dconf/db/local.d/locks/01-power file:
    /org/gnome/settings-daemon/plugins/power/power-button-action
    
    Copy to Clipboard Toggle word wrap
  3. Update the system databases:
    # dconf update
    Copy to Clipboard Toggle word wrap
  4. Log out and back in again before the system-wide settings take effect.
This configuration initiates a system shutdown after pressing the power button. To configure the system differently, you can set the behavior of particular buttons.

Options for particular buttons

nothing
does nothing
suspend
suspends the system
hibernate
hibernates the system
interactive
shows a pop-up query asking the user what to do
With interactive mode, the system powers off automatically after 60 seconds when hitting the power button.
However, you can choose a different behavior from the pop-up query as shown in the figure below.

Figure 13.2. Pop-up query for interactive mode

Retour au début
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2025 Red Hat