Chapter 7. Customizing GNOME desktop features

7.1. Changing the language using desktop GUI

This section describes how to change the system language using the desktop GUI.

Prerequisites

  • Required language packages are installed on your system

Procedure

  1. Open the GNOME Control Center from the System menu by clicking on its icon.

    cs system menu

  2. In the GNOME Control Center, choose Region & Language from the left vertical bar.
  3. Click the Language menu.

    cs language menu

  4. Select the required region and language from the menu.

    cs select region language

    If your region and language are not listed, scroll down, and click More to select from available regions and languages.

    cs available region language

  5. Click Done.
  6. Click Restart for changes to take effect.

    cs restart region language

Note

Some applications do not support certain languages. The text of an application that cannot be translated into the selected language remains in US English.

Additional resources

  • For more information on how to launch the GNOME Control Center, see approaches described in Launching applications

7.2. Enabling the CTRL+ALT+BACKSPACE shortcut

The Ctrl+Alt+Backspace shortcut key combination is used for terminating the X.Org display server.

You might want to terminate X.Org especially when:

  • A program caused X.Org to stop working.
  • You need to switch from your logged-in session quickly.
  • You have launched a program that failed.
  • You cannot operate in the current session.
  • Your screen freezes.

To enable the Ctrl+Alt+Backspace shortcut to forcibly terminate X.Org by default for all users, you need to set the org.gnome.desktop.input-sources.xkb-options GSettings key.

Procedure

  1. Create a local database for machine-wide settings in /etc/dconf/db/local.d/00-input-sources:

    [org/gnome/desktop/input-sources]
    # Enable Ctrl-Alt-Backspace for all users
    xkb-options=['terminate:ctrl_alt_bksp']
  2. Override the user’s setting, and prevent the user from changing it in /etc/dconf/db/local.d/locks/input-sources:

    # Lock the list of enabled XKB options
    /org/gnome/desktop/input-sources/xkb-options
  3. Update the system databases for the changes to take effect:

    # dconf update
  4. Users must log out and back in again before the system-wide settings take effect.

If the Ctrl+Alt+Backspace key combination is enabled, all users can terminate X.Org , which brings them back to the login prompt.

7.3. Disabling command-line access

To disable command-line access for a desktop user, you need to make configuration changes in a number of different contexts:

Note

The following steps do not remove the desktop user’s permissions to access a command line, but rather remove the ways that the desktop user could access command line.

7.3.1. Setting the org.gnome.desktop.lockdown.disable-command-line Key

This approach prevents the user from:

  • Accessing the terminal
  • Specifying a command line to be executed by using the Alt+F2 command prompt

Procedure

  1. Create a local database for machine-wide settings in /etc/dconf/db/local.d/00-lockdown:

    [org/gnome/desktop/lockdown]
    # Disable command-line access
    disable-command-line=true
  2. Override the user’s setting and prevent the user from changing it in /etc/dconf/db/local.d/locks/lockdown:

    # Lock the disabled command-line access
    /org/gnome/desktop/lockdown
  3. Update the system databases:

    # dconf update
  4. Users must log out and back in again before the system-wide settings take effect.

7.3.2. Disabling virtual terminal switching on X.Org

With the X.Org display server, users can normally use the Ctrl+Alt+function key shortcuts to switch from the GNOME Desktop and X.Org to a virtual terminal. You can disable access to all virtual terminals by modifying the X.Org configuration. The X.Org configuration should be modified by adding the DontVTSwitch option to the Serverflags section of an X configuration file in the /etc/X11/xorg.conf.d/ directory, as shown by the following procedure.

Important

You cannot apply the procedure if GNOME Shell on Wayland is used as the display server.

Procedure

  1. Create or edit an X configuration file in the /etc/X11/xorg.conf.d/ directory:

    Note

    By convention, these host-specific configuration file names start with two digits and a hyphen and always have the .conf extension. Thus, the following file name can be /etc/X11/xorg.conf.d/10-xorg.conf.

    Section "Serverflags"
    
    Option "DontVTSwitch" "yes"
    
    EndSection
  2. Restart the X.Org display server for the changes to take effect.

7.4. Preventing the computer from suspending when closing the lid

When closing the lid of your laptop, the computer by default suspends in order to save power. You can prevent the computer from suspending when closing the lid by changing the setting for that behavior.

Warning

Some laptops can overheat if they are left running with the lid closed, especially if they are in a confined place. Therefore, consider whether changing the default setting from suspend to an other option is beneficial in your case.

Procedure

  1. Open the /etc/systemd/logind.conf file for editing.
  2. Find the HandleLidSwitch=suspend line in the file.

    If it is quoted out with the # character at the start, unquote it by removing #.

    If the line is not present in the file, add it.

  3. Replace the default suspend parameter with:

    • lock for the screen to lock
    • ignore for nothing to happen
    • poweroff for the computer to switch off

      For example:

      [Login]
      HandleLidSwitch=lock
  4. Save your changes, and close the editor.
  5. Run the following command so that your changes preserve the next restart of the system:

    # systemctl restart systemd-logind.service
Warning

Restarting the service forcibly interrupts any currently running GNOME session of any desktop user who is logged in. This can result in users losing unsaved data.

For more information on the /etc/systemd/logind.conf file, see the logind.conf man page.

7.5. 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

  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'
  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
  3. Update the system databases:

    # dconf update
  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.

    Pop-up query for interactive mode

    interactive power