The Questions
How to adjust the idle delay time for screensaver activation?
How to lock the screen after screensaver is activated?
How to mandate these settings systemwide for all users?
How to disable the screensaver /screenlock?
The Answer
Available Dconf (gsettings) Configuration Keys
– Dconf keys can be used to configure the screensaver behavior, which resides under org.gnome.desktop.session.
– idle-delay can be set to blank the screen after a specified number of seconds of inactivity.
– lock-delay can be set to enable screen lock a specified number of seconds after the screen has blanked (after idle-delay).
There are a few other keys available to customize the behavior.
How to set activation time and lock time
The commands below show how to:
Blank the screen after 3 minutes of inactivity.
Lock the screen 5 minutes after it has blanked the screen.
– Per-user settings (for the idle and lock delay)
Each user can change their own settings separately. Execute the following commands as the user that needs the settings changed
# gsettings set org.gnome.desktop.session idle-delay 180 # gsettings set org.gnome.desktop.screensaver lock-delay 300 # gsettings set org.gnome.desktop.screensaver lock-enabled true
Global Mandatory settings (for the idle and lock delay)
System wide mandatory settings can also be enforced for all users. Create or edit the the files below with the following content (as root):
# cat /etc/dconf/db/local.d/00-screensaver [org/gnome/desktop/session] idle-delay=uint32 180 [org/gnome/desktop/screensaver] lock-enabled=true lock-delay=uint32 300
# cat /etc/dconf/db/local.d/locks/screensaver /org/gnome/desktop/session/idle-delay /org/gnome/desktop/screensaver/lock-enabled /org/gnome/desktop/screensaver/lock-delay
Afterwards run the command below to apply the settings:
# dconf update
Disabling the Screensaver
1. The blanking and locking of a screensaver can be disabled if desired.
2. Set the following for the keys based on the above methods:
– Set the idle-delay to 0 to prevent activation of the screensaver.
– Set the lock-enabled to false to prevent locking of the screen.
Some Key Definitions
idle-delay
Time before session is considered idle. [org/gnome/desktop/session]. The number of seconds of inactivity before the session is considered idle. (default: 300)
lock-enabled
Lock on activation. [org/gnome/desktop/screensaver]. Set this to TRUE to lock the screen when the screensaver goes active. (default: true)
lock-delay
Time before locking. [org/gnome/desktop/screensaver]. The number of seconds after screensaver activation before locking the screen. (default: 0)
user-switch-enabled
Allow user switching. [org/gnome/desktop/screensaver]. Set this to TRUE to offer an option in the unlock dialog to switch to a different user account. (default: true)