ArticlesRocky Linux

Managing Screen Lock Preferences in XFCE on Rocky Linux

Introduction

This article provides step-by-step guidance on how to modify screen lock settings in the XFCE desktop environment on Rocky Linux. Whether you need to disable the screen lock for remote sessions or enforce a 10 minute inactivity timeout for local logins, this document offers both GUI and CLI-based solutions. The methods discussed here are aimed at helping you lock or unlock specific settings. Ensuring consistency and security across different session types, whether that be local or via a remote session.

Problem

There are often challenges in screen lock preferences, especially when different environments require conflicting behaviors. In some instances, remote sessions should have the lock disabled to avoid disruptions, while local sessions must enforce a 10 minute timeout for security.

Symptoms

  • The screen lock activates automatically at inappropriate times.

  • Changes via the GUI or xfce4-settings-editor are not immediately apparent, leading to user confusion.

Resolution

Prerequisites

  • Rocky Linux 8.10 installed on a test machine.

  • A fully updated system.

  • XFCE desktop installed and properly configured.

  • (Optional) NoMachine configured for remote access testing.

Screenlock configuration methods

GUI method

Power Manager – System
  • Open Settings → Power Manager → System.

  • Set the When inactive for option to Never to disable automatic screen locking.

  • Ensure that under Security, the Lock screen when system is going to sleep option is unchecked.

Power Manager – Display:
  • Open Settings → Power Manager → Display.

  • Confirm that Display power management is set to ON.

  • Set Blank after, Put to sleep after, and Switch off after to Never.

Screensaver Settings:
  • Open Settings → Screensaver.

  • Disable the Enable Screensaver option.

  • Under Lock Screen, uncheck the Enable Lock Screen option.

CLI method

To disable the automatic screen lock for the session:
xfconf-query -c xfce4-session -p /general/LockCommand -s ""
To re-enable the lock screen:
xfconf-query -c xfce4-session -p /general/LockCommand -s "/usr/bin/gnome-screensaver-command --lock"
Toggle the power management (DPMS-Display Power Management Signaling-controls whether screen blanking runs or not) setting on/off:
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-enabled -T
Toggle the screen lock on/off:
xfconf-query -c xfce4-screensaver -p /lock/enabled -T
Toggle the screensaver on/off:
xfconf-query -c xfce4-screensaver -p /saver/enabled -T
To disable the lock screen:
xfconf-query -c xfce4-screensaver -p /lock/enabled -s false
To enable the lock screen:
xfconf-query -c xfce4-screensaver -p /lock/enabled -s true
Add a 10 minute delay before the screen locks:
xfconf-query -c xfce4-screensaver -p /lock/saver-activation/delay -s 10
How to verbosely list settings:
xfconf-query -c xfce4-power-manager -l -v
xfconf-query -c xfce4-screensaver -l -v
xfconf-query -c xfce4-session -l -v

Root cause

The challenges encountered stem from XFCE’s management of screen lock settings across multiple independent components (Power Manager, Screensaver, and Session settings). These components can lead to conflicting behaviors when trying to restrict or enforce specific lock preferences, especially in environments that require different configurations for remote versus local sessions.

Notes

Always test changes in a controlled or non-production environment before deployment.

Tip: Keep the xfce4-settings-editor open during any changes to observe the settings being updated in real-time.

References & related articles

XFCE Power Manager Documentation
XFCE Screensaver Configuration Documentation
NoMachine for Linux