How to adjust screen lock settings on Linux desktop

Every major Linux desktop nowadays comes with a screensaver program by default (e.g., xscreensaver), which then can be used to lock the screen for security purposes. The default screensaver is typically configurable, and you can change settings like inactivity period or screen lock delay. You may want to adjust these settings based on your typical work environment. Also, in case you want prevent your screen from going off and locked down for an extended period of time (e.g., when watching a movie), you probably want to disable screen lock feature.

In this tutorial, I am going to show how to control screen lock on various Linux desktop environment.

GNOME 3 Desktop

Go to "System Settings" -> "Brightness and Lock". In this setting, you can set screen inactivity period and screen lock delay. Also, you can enable or disable screen locking.

If you want to control screen lock from the command line, here is how to do it.

To activate screensaver and lock the screen after 10 minutes:

$ dconf write /org/gnome/desktop/session/idle-delay 600

To disable screen lock:

$ dconf write /org/gnome/desktop/screensaver/lock-enabled false

Alternatively, you can use dconf-editor, a GUI-frontend for dconf command.

To install dconf-editor on Debian, Ubuntu or Linux Mint:

$ sudo apt-get install dconf-tools

To install dconf-editor on Fedora:

$ sudo yum install dconf-editor

To launch dconf-editor, simply run it.

$ dconf-editor

KDE Desktop

Go to "System Settings" -> "Display and Monitor". Choose "Screen Locker" menu in the left. Here, you can change screen inactivity period and screen lock delay. Also, you can enable or disable screen locking. In this example, screensaver will be launched after 15 minutes of inactivity. After 300 seconds from that point on, screen lock will be activated, requiring password authentication.

To adjust screen lock settings from the command line, you can edit ~/.kde/share/config/kscreensaverrc. Create the file if it does not exist. Once the file is edited, the change will automatically take effect immediately.

$ vi ~/.kde/share/config/kscreensaverrc


To disable screen lock, simply change the following setting in ~/.kde/share/config/kscreensaverrc.


Xfce/LXDE Desktop

Go to "Settings Manager" -> "Screensaver". In this settings, you can change screensaver activation time and screen lock delay, as well as enable/disable screen lock.

Once you change screensaver preferences via GUI like above, it will create ~/.xscreensaver, which is a screensaver preference file. You can also edit this file manually to adjust screen lock settings, without going through GUI.

$ vi ~/.xscreensaver

To disable screen lock, simply change the setting in ~/.xscreensaver

Lock: False

Linux Mint MATE/Cinnamon Desktop

You can follow the same steps as in GNOME 3 desktop.

Subscribe to Xmodulo

Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.

Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support Xmodulo!

The following two tabs change content below.
Dan Nanni is the founder and also a regular contributor of He is a Linux/FOSS enthusiast who loves to get his hands dirty with his Linux box. He likes to procrastinate when he is supposed to be busy and productive. When he is otherwise free, he likes to watch movies and shop for the coolest gadgets.

One thought on “How to adjust screen lock settings on Linux desktop

  1. You might want to update the section "Linux Mint MATE/Cinnamon Desktop" to indicate for which release(s) you can follow the same steps listed in your GNOME 3 instructions. I'm currently running Mint 17 (Qiana) with MATE (which was released since you posted this tutorial) and these instructions do not work for this version. I don't know if the procedure is any different using Cinnamon, but for MATE, the screensaver and screen lock settings can be modified under Control Panel > Personal > Screensaver` and for power management related lock settings, Control Panel > Hardware > Power Management.

Leave a comment

Your email address will not be published. Required fields are marked *