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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • 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. dnsspoof: command not found
  2. if Command Examples in Linux
  3. laptop-detect Command Examples in Linux
  4. BTRFS: too many missing devices, writeable mount is not allowed
  5. namei Command Examples in Linux
  6. How to map /dev/sdX and /dev/mapper/mpathY device from the /dev/dm-Z device
  7. imgp Command Examples in Linux
  8. CentOS / RHEL 7 : Never run the iptables service and FirewallD service at the same time!
  9. pluma Command Examples in Linux
  10. logsave Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright