System Settings - Screen Locking not happening automatically

I have a habit of meta-L screen locking when I walk away from my PC, but recently while working through some troubleshooting scenarios I discovered that my setting to do this automatically after 5 minutes was not happening.

I found a post that provided a script to control screen locking and energy saving in one go. Interestingly,
loginctl lock-session 1 accomplished nothing.

So I brought up the man page for loginctl and executed loginctl list-sessions

2 1000 myuid seat0

1 sessions listed.

Revised the command to loginctl lock-session 2 and it worked instantly! This is my revised shell script…

loginctl lock-session 2
read -t 5 -p “Wait 5 seconds to ensure the screen locks before turning off monitors.”
xset dpms force off

So this leaves me wondering why the automatic screen locking is not working…

  1. Is it also expecting me to be in “Session 1” like the script… perhaps a bug? -or-
  2. Is there something odd going on that I can address in why my session is not #1?

Some applications inhibit automatic screen locking. If this is happening the culprit(s) will be listed on the Battery and Brightness plasmoid, sometimes with a reason.

Ah ha, thank you for this information flux… I see 2 entries there (3 if I have the steam store page open):

  1. .steamwebhelper:Video Wake Lock goes away if the steam UI is closed (minimized to the systray too)
  2. My DSL application: Playing a game goes away if steam is completely closed (not in systray)
  3. Activity Manager … this one stumps me… I’ve closed everything I opened and it persists. It’s not related to this “Default” Activity that apparently isn’t setup to do anything, is it?

Take a look at Activity Power Settings. Have you set anything special there?

yes, I did set one option while I was troubleshooting what I thought might be a hibernation/suspend issue… but it’s worded more related to shutdown and sleep, so I assume not lock screen related

Automatic sleep and screen locking are not differentiated when it comes to inhibition by applications (see wording on your second screenshot).

If you revert your change to Activity Power Settings, then the Activity Manager inhibition will go away.

Thank you flux!

A good example of “implied same/related things” definitely being a learning curve.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.