# [SOLVED] Screen not locked after suspend

## victorsk

Good day everyone,

I've installed Gentoo kde-plasma 5.5.1 with SDDM display manager and I am two steps away from a perfect system.  One problem I have here is the screen doesn't lock after resuming from sleep mode.  I definitely checked "lock screen on resume" option in Screen Locking section but it's not working.  I've done extensive research and found that the trick to solving is to ensure that screen has to actually somehow lock before going to suspend mode.  I also have Gentoo XFCE system on my other laptop and screen locking works there so I tried to apply working technique by removing upower-pm-utils and installing only pm-utils.  That didn't work.  In fact, without upower-pm-utils I can't even see the "Sleep" option in close on lid.  Unfortunately, solution that works with XFCE doesn't work with plasma.  I also use exactly the same kernel configuration I used in my previous Gentoo Plasma set up where screen locking did work after resume.  The only difference between my previous Gentoo plasma install (over which I installed the current one) is that in previous I had LightDM as my DM and this time I SDDM.  I also ensured that I have kde-plasma power management package installed.  

So if I want to have screen locked after suspend, I have to manually lock it before closing the lid.  Is there a way to automate the screen locking part before going to sleep?  This is the only solution I can think of.  If there is more elegant solution, please let me know. 

ADDED: In my previous Plasma installation (LightDM) I had screen lock appear after suspend but sometimes the screen lock didn't kick in right away and entire desktop conents were visible.  Thus, I believe it would be a better solution to automatically lock the screen before the suspend kicks in to ensure that after suspend the screen remains locked.  This is the problem also discussed here:

http://blog.martin-graesslin.com/blog/2015/01/locking-the-screen-before-system-suspends/

And so I am looking for a way to automatically lock screen before suspend.

Thank you kindly,

Victor.Last edited by victorsk on Sun Dec 27, 2015 7:55 pm; edited 1 time in total

----------

## ophuls

Hi Victor,

I had the same problem after updating plasma to 5.5.0 (before was working good using SDDM).

I solved it uninstalling upower-pm-utils and updating sys-auth/consolekit to ver. 1.0.0-r1.

After this I also lost the "Suspend" and "Hibernate" options but I get it back adding the following files to /etc/polkit-1/localauthority/50-custom.d/

```
$ ls /etc/polkit-1/localauthority/50-custom.d/

20-org.freedesktop.consolekit.system.suspend-multiple-users.pkla

30-org.freedesktop.consolekit.system.hibernate-multiple-users.pkla

```

Here is the content of the files:

20-org.freedesktop.consolekit.system.suspend-multiple-users.pkla

```
[Allow all users to suspend]

Identity=unix-group:users

Action=org.freedesktop.consolekit.system.suspend-multiple-users;org.freedesktop.consolekit.system.suspend

ResultAny=yes

ResultInactive=no

ResultActive=yes
```

30-org.freedesktop.consolekit.system.hibernate-multiple-users.pkla

```
[Allow all users to hibernate]

Identity=unix-group:users

Action=org.freedesktop.consolekit.system.hibernate-multiple-users;org.freedesktop.consolekit.system.hibernate

ResultAny=yes

ResultInactive=no

ResultActive=yes
```

I still have the sometimes the glitch on resume (desktop will show for fraction of a second before the locking screen). 

Hope this can help

thomas

----------

## victorsk

 *ophuls wrote:*   

> Hi Victor,
> 
> I had the same problem after updating plasma to 5.5.0 (before was working good using SDDM).
> 
> I solved it uninstalling upower-pm-utils and updating sys-auth/consolekit to ver. 1.0.0-r1.
> ...

 

It worked!  Thank you for your advise   :Smile:    They should definitely change your skill to a higher level   :Very Happy: 

----------

