Xdg-screensaver and "local policies"

According to its man page, xdg-screensaver activate

Turns the screensaver on immediately. This may result in the screen getting locked, depending on existing system policies

I’d like to be able to fire this off without immediately locking the screen but at the moment these policies seem to be forcing it to lock.

I can see from the process list that xdg-screensaver launches kscreenlocker_greet. This has a command-line option “–nolock”, but even with that the screensaver locks, so I think it must be overriding that from a configuration somewhere.

I’ve hunted round search engines and various files to find out where these policies are set without success. Does anyone know how they’re set/changed?
Thanks.

If I understand correctly and this setting is applied generally, then it is

System Settings > Power Management > "On AC Power" (tab) | "On Battery" (tab) > Display and Brightness > Turn off screen > "When Locked N minute" (menu)

Imgur

Thanks for the suggestion. Unfortunately my problem isn’t getting something to run after the screen is locked - it’s preventing the screen from locking immediately the screensaver is invoked.

Could a way to do this not be running a script that checks for input after the screensaver and if a certain time has passed with no activity, lock it??

Edit:

Or have a look at

I use it myself.

I suppose its not for screen saver … but

System Settings > Screen Locking > Delay before password required

might have the same effect ?

1 Like

(Why) Does the screensaver even need to trigger locking the screen/session?
Can’t it just be “saving the screen”? Or blanking it? Without locking it?
Then you’d only have to contend with the screen being locked …

What is the use for such screen saver anyway - which then would be only hide the screen content until someone moves the mouse or pressed a key?

… probably not a helpful comment - sorry!

This is how my screen locking is configured.

I don’t know how xdg-screensaver might interact, but maybe whatever screen locking settings you have in place, are competing.

System SettingsSecurity & PrivacyScreen Locking:

  • Lock screen automatically: 15 minutes
    Lock after waking from sleep

  • Delay before password required: 5 minutes


Locking (eventually) is useful on the odd occasion I have to leave my session running when I go out; in the (admittedly low-probability) event of someone breaking in, it would at least stop them getting into it.

With modern screens a “saver” as such isn’t as necessary as it used to be with CRT monitors where burn-in could be problematic. I just enjoy having a slideshow of my photos on the screen when I’m not actually using the computer.

Mine’s set to Lock screen automatically: Never.

But annoyingly xdg-screensaver (and indeed /usr/lib/kscreenlocker_greet, which it calls) still locks immediately. It must be a setting outside of the home directory, because copying my entire home directory to a new user results in it not locking. But I really don’t want to have to completely re-jig everything for a new user.

I’ve got “Lock screen automatically” there set “never”. Whatever’s making it lock immediately seems to be outside of my home directory, from testing I’ve done.

I think I’ve managed a (messy) workaround which involves using xscreensaver initially, then triggering xdg-screensaver after a predetermined period to then lock the screen. Unfortunately xscreensaver can’t do screen locking on Wayland.

… I see you understand where I was getting at.

But I do not use Plasma myself - I find it much too complicated and option bloated for my taste.

I have long ago decided on Xfce4 - or even just well configured window managers like in the Bunsenlabs Debian variant.

I do have Manjaro Plasma in a VM - but I’m afraid I can’t help you with your particular issue.

It seems to me that you have chosen a fairly complicated way of doing something which is actually very simple to do on Plasma Wayland.

All you need to do is go into System Settings → Screen Locking, select “Lock Screen Automatically”, choose the the period of inactivity before the screen will lock, and set a suitable delay before a password is required to unlock the screen. I just set mine up to lock after 1 minute, and allow unlocking without a password for 30 seconds:

Screenshot_20250114_082554

I then clicked on Screen Locking’s “Configure Appearance” button (highlighted in red on the screenshot above), and selected to show a slideshow of pictures from my wallpaper folders when the screen is locked, with the image changing every 7 seconds:

Moving the mouse within the first 30 seconds takes me straight back to my desktop; moving the mouse after 30 seconds requires me to enter my password to go back to the desktop.

1 Like

@beermad - Now I see what you are ultimately trying to achieve, I have to agree with @scotty65.


I keep a directory of wallpapers under the ~/.local heirarchy and select that directory in the Wallpaper dialog:

Wallpaper type: Slideshow

(set to change every 15 minutes, or any interval I choose)

If the pictures you wish to cycle are not 16:9 ratio (suitable for wallpaper, for example) and are photographs with random dimensions, you can also change the way they are scaled and positioned:

Positioning: Scaled, keep proportions

(or possibly Centered)


I think you could likely find an acceptable combination just from Plasma’s own Wallpaper settings.

Something to consider.

Regards.

This is the strange thing. Even if I set that up to lock the screen automatically, it doesn’t fire up the screensaver. If I log in with another user and do the same it works fine.

I’m pretty sure I did something many years ago to suppress the KDE screensaver because I preferred xscreensaver and at the time there was no simple way to disable KDE’s. Unfortunately I can’t work out what it was. It was evidently not something under my home directory, as copying the entirety of that to another user results in the screensaver being launched as expected. Pity I didn’t make a note of what it was at the time…

Entirely self-inflicted.