• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How To Customize The Screensaver Options In Gnome on CentOS/RHEL 7

By admin

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
Note: The file in /etc/dconf/db/local.d/locks/ makes the settings mandatory.

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.

Note: Other keys and their details can be found under /usr/share/glib-*/schemas/org.gnome.desktop.screensaver.gschema.xml

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)

Filed Under: CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. How to create snapshot of LVM thin volumes using snapper command
  2. How to Audit for Modifications to files and Executions of Files in Linux
  3. How to Enable Disk Quotas on an XFS File System
  4. How to verify if NX/XD is Enabled or Disabled in CentOS/RHEL 7 and 8
  5. How to check failed or bad login attempts in Linux
  6. Troubleshooting Common GUI / X-Window Issues on CentOS/RHEL
  7. CentOS / RHEL : How to set chroot jail for vsftp for all the users
  8. CentOS / RHEL 7 : How to set date, time / NTP and timezone using timedatectl
  9. Downgrading an rpm package to a lower version (using “rpm” command)
  10. How to restore files under user’s home directory to default in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Oracle Database – Configuring Secure Application Roles
  • Extend rule sets by using factors in Oracle Database Vault
  • What are Command Rules in oracle Database
  • Using Rule Sets in Oracle Database Vault
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary