1. Overview

The screensaver is a helpful feature that activates when the screen is idle for a specified period. It can conserve energy and prevent screen burn-in. However, screensavers can also be a nuisance, especially in Linux systems. For instance, they can interrupt ongoing activities or prevent tasks from running effectively.

In this tutorial, we’ll discuss how to permanently disable the screensaver system-wide in Linux. We’ll use the dconf and gsettings commands in the command line. Importantly, we’ll focus on the GNOME desktop environment.

2. Using the dconf Command

dconf is a powerful tool in the GNOME desktop environment used to read, write and change configuration settings in the dconf database. It allows us to interact with the dconf system from the command-line interface.

In detail, the dconf system is responsible for managing and storing user and system settings. In addition, we don’t need superuser rights to disable the screensaver using the dconf command.

The dconf command follows a general syntax:

$ dconf <command> <schema-path>/<key> [<value>]

Further, dconf has a number of options:

  • command – action we want to perform on the dconf database such as read, write, reset, list, dump, or load
  • schema-path – path to the schema within the dconf database that contains the key we want to change
  • key – key within the schema path we want to read, write, or change
  • value – optional parameter used with the write command to specify the value we want to set for the specified key

So, we’ll start by checking the status of the screensaver settings:

$ dconf read /org/gnome/desktop/screensaver/idle-activation-enabled
true

In the above command, we use read to check the value of the idle-activation-enabled key in the org/gnome/desktop/screensaver schema. Here, we get true as the output, indicating the screensaver is currently enabled on our computer.

Now, we can disable the screensaver:

$ dconf write /org/gnome/desktop/screensaver/idle-activation-enabled false

In this example, the write command updates the value of the idle-activation-enabled key. Changing the key at org/gnome/desktop/screensaver to false disables the screensaver idle activation.

Now, let’s verify that we’ve disabled the screensaver:

$ ​​​​dconf read /org/gnome/desktop/screensaver/idle-activation-enabled
false

Above, the output false indicates that we’ve been successful.

3. Using the gsettings Command

The gsettings command is a Linux command-line tool used to change and retrieve application settings. Additionally, it provides a way for us to change and access various configuration options in GNOME-based systems. Also, when using this command, we can disable the screensaver without superuser rights, unless it affects multiple users.

First, we’ll start by checking for the schema associated with our screensaver. To be clear, we do this since each GNOME setting links to a specific schema:

$ gsettings list-schemas | grep screensaver
com.canonical.unity.desktop.screensaver
org.gnome.desktop.screensaver

By default, executing the gsettings list-schemas command lists all the schemas available in our GNOME database. Thus, we use the grep command to filter out the schemas associated with the screensaver settings.

Next, we check for the status of the idle-activation-enabled screensaver setting at org.gnome.desktop.screensaver:

$ gsettings get org.gnome.desktop.screensaver idle-activation-enabled
true

After running get as we did above, we see true as the output, indicating that the screensaver is currently enabled on our computer.

Now, let’s see how we can disable the screensaver via gsettings:

$ gsettings set org.gnome.desktop.screensaver idle-activation-enabled false

In this step, we set the value of the idle-activation-enabled key within the org.gnome.desktop.screensaver schema to false.

Further, let’s confirm that we’ve disabled the screensaver:

$ gsettings get org.gnome.desktop.screensaver idle-activation-enabled
false

The above command displays false as the output, indicating that we’ve successfully disabled the GNOME screensaver.

As a precaution, we can also disable the lock screen:

$ gsettings set org.gnome.desktop.screensaver lock-enabled false

The above command sets the lock-enabled key within the org.gnome.desktop.screensaver schema to false. In detail, this prevents the system from locking after a period of inactivity.

As we’ve done previously, let’s confirm whether the lock screen is inactive:

$ gsettings get org.gnome.desktop.screensaver lock-enabled
false

From the above output, we get a value of false. At this point, both the screensaver and lock screen have been disabled successfully.

4. Conclusion

In this article, we discussed how to permanently disable the screensaver system-wide in GNOME. In particular, we explored how to use the dconf and gsettings commands to achieve our goals. With each tool, we delved into the GNOME schema and then extracted and set the respective values.

Comments are open for 30 days after publishing a post. For any issues past this date, use the Contact form on the site.