KDE Desktop lock screen configuration

The KDE desktop environment is highly customizable, including the GUI’s lock screen. The lock screen can be configured and customized via the GUI’s settings menu or from a configuration file via the command line. In this tutorial, you will learn various ways to customize the desktop lock screen in the KDE desktop environment on a Linux system.

In this tutorial you will learn:

  • How to configure KDE desktop lock screen via command line and GUI
  • How to adjust lock screen timeout
  • How to disable or enable auto lock screen
  • How to use commands and shortcuts to access lock screen
  • How to unlock the KDE lock screen
KDE Desktop lock screen configuration
KDE Desktop lock screen configuration
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Any Linux distro
Software KDE desktop environment
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

Adjust lock screen timeout



  1. To adjust the time it takes for the lock screen to automatically pop up, start by opening the application launcher and navigating to System Settings.
    Open System Settings in KDE
    Open System Settings in KDE
  2. Then, navigate to the Workspace Behavior tab, followed by Screen Locking.
    The screen lock settings are inside of the Workspace Behavior tab
    The screen lock settings are inside of the Workspace Behavior tab
  3. From this menu, adjust the time it takes for the screen to automatically lock. Alternatively you can disable the automatic lock completely, and even disable the lock screen from showing up when your computer wakes up.
    Adjusting the lock screen timeout setting in KDE
    Adjusting the lock screen timeout setting in KDE
  4. Click the Apply button to save your changes, then you can close this menu and the changes will take effect.

Change lock screen wallpaper

  1. To configure your KDE lock screen wallpaper, once again navigate to System Settings > Workspace Behavior > Screen Locking. In this menu, click on the Configure button under the Appearance section.
    Click on configuration to select a new wallpaper
    Click on configuration to select a new wallpaper
  2. Now select a new wallpaper from the default choices or click on “Add image” to put a custom wallpaper.



    Add image to select a custom wallpaper from your files
    Add image to select a custom wallpaper from your files

  3. Select your image, click Apply, then close the menu. Afterwards, lock your screen to verify the new change.
    We have successfully changed our KDE lock screen wallpaper
    We have successfully changed our KDE lock screen wallpaper

If you would rather change the KDE lock screen wallpaper from command line, you can use the following command syntax:

$ kwriteconfig5 --file kscreenlockerrc --group Greeter --group Wallpaper --group org.kde.image --group General --key Image "file:///home/linuxconfig/Pictures/summer.avif"

Just replace the above file path with the location of your own image file that you wish to use.

Command and shortcuts to access lock screen

  1. To lock your screen from the command line, execute the following in terminal (note this will only work on distros that have systemd):
    $ loginctl lock-session
    

    Another way of accomplishing the same thing, albeit with a much longer and harder to remember command:

    $ qdbus org.kde.ksmserver /ScreenSaver org.freedesktop.ScreenSaver.Lock
    
  2. You can also use the Meta + L keyboard combination to access the lock screen from anywhere. Note: normally the Meta key is the one with a Windows logo on most keyboards.
  3. The third way to access the lock screen is to right click on your desktop and click “Lock Screen.”



    Locking the screen from the KDE desktop
    Locking the screen from the KDE desktop

Disable or enable auto lock screen

To disable your screen from automatically locking after a period of inactivity or when your computer wakes up from sleep mode, navigate to System Settings > Workspace Behavior > Screen Locking. In this menu, adjust the two settings as seen in the screenshot below:

Disabling or enabling the auto lock screen function
Disabling or enabling the auto lock screen function

To disable the lock screen, uncheck both boxes. To enable the lock screen, keep both boxes checked. Apply changes when done and then close the menu.

How to unlock the KDE lock screen

To unlock your KDE lock screen, you will need to move the mouse around or press any key on your keyboard. This will make the password prompt appear.

KDE lock screen password prompt
KDE lock screen password prompt

Once it appears, enter your password and press Enter to unlock your system.

Configure automatic login

To configure automatic login for your KDE desktop, see our dedicated tutorial on KDE auto login to GUI Plasma Desktop.

Closing Thoughts




In this tutorial, we saw how to configure various settings for the KDE desktop lock screen on a Linux system. This included methods from both the GUI and command line, where applicable. As with most things in Linux, we are able to customize and personalize granular settings in order to achieve the ideal result, and the lock screen proves to be no exception.



Comments and Discussions
Linux Forum