This forum has been archived. All content is frozen. Please use KDE Discuss instead.

lock after auto login

Tags: None
(comma "," separated)
giok
Registered Member
Posts
11
Karma
0
OS

lock after auto login

Sat Apr 15, 2017 8:39 pm
I would lock screen when auto login is enabled. Is there a way to obtain it in a simple way?
There is a bug 346741 regarding this option but it's it waiting for a solution.
User avatar
Rog131
Registered Member
Posts
828
Karma
10

Re: lock after auto login

Sun Apr 16, 2017 6:00 am
Auto lock after auto login from the cold boot with the SDDM

Earlier: Lock screen programatically - viewtopic.php?f=67&t=128548

The lock can be initiated with the command:
Code: Select all
loginctl lock-session


1) Writing oneliner - autolock.sh and making it executable:
Code: Select all
#!/bin/sh
loginctl lock-session


2) Adding it to the autostart - KDE System Settings > Startup and Shutdown > Autostart (Run On Startup)

Image

3) Setting the Auto Login on KDE System Settings > Startup and Shutdown > Login Screen (SDDM) > Advanced > Auto Login

Image


Testing ... working at here.

Note !
This will lock the screen always. If you only want to lock when the auto login is enabled you could read the autologin status from the /etc/sddm.conf and then lock or not.


More:
Unlocking with the cli: viewtopic.php?f=289&t=130691
giok
Registered Member
Posts
11
Karma
0
OS

Re: lock after auto login

Sun Apr 16, 2017 8:14 am
Thanks for your answer that's easy to implement thanks to your very detailed description.

Rog131 wrote:This will lock the screen always.
In fact every time screen lock you have to enter the password twice. It should be better if script is executed at boot only but I don't know if it's possible.

If you only want to lock when the auto login is enabled you could read the autologin status from the /etc/sddm.conf and then lock or not.
This is too complicated for me, I don't know how to test a condition in a script. But it's not so important too, I've auto login permanently enabled.
User avatar
Rog131
Registered Member
Posts
828
Karma
10

Re: lock after auto login  Topic is solved

Sun Apr 16, 2017 9:19 am
giok wrote:Thanks for your answer that's easy to implement thanks to your very detailed description.

Rog131 wrote:This will lock the screen always.
In fact every time screen lock you have to enter the password twice. It should be better if script is executed at boot only but I don't know if it's possible.


With the cold/hard boot the password should be asked only once, by the lock screen - with the VBox: https://youtu.be/WV17NfIZNRU

If you are switching the user then there is the SDDM password and the lock screen password.
giok
Registered Member
Posts
11
Karma
0
OS

Re: lock after auto login

Sun Apr 16, 2017 9:58 am
You're right. Password is asked twice only at login and this is not a big problem.
Hope bug will be solved and in the meantime this is a good solution. Thanks.
User avatar
MirceaKitsune
Registered Member
Posts
330
Karma
0
OS

Re: lock after auto login

Mon Apr 17, 2017 8:05 pm
I'm having the same problem, and that solution looks like a decent workaround. However I really believe this is something that should be fixed within SDDM itself, which in my opinion should offer a checkbox for automatically locking the screen after auto-login.
giok
Registered Member
Posts
11
Karma
0
OS

Re: lock after auto login

Tue Apr 18, 2017 7:57 am
MirceaKitsune wrote:However I really believe this is something that should be fixed within SDDM itself,
Bug #346741 asks for restoring this feature that we had in KDE4. You could add your request to increase the probability this feature is restored.

which in my opinion should offer a checkbox for automatically locking the screen after auto-login.
This is the solution adopted in KDE4 that could be perfect for Plasma too, see my attachment in Bug #346741.
User avatar
MirceaKitsune
Registered Member
Posts
330
Karma
0
OS

Re: lock after auto login

Tue Apr 18, 2017 1:19 pm
giok wrote:
MirceaKitsune wrote:However I really believe this is something that should be fixed within SDDM itself,
Bug #346741 asks for restoring this feature that we had in KDE4. You could add your request to increase the probability this feature is restored.

which in my opinion should offer a checkbox for automatically locking the screen after auto-login.
This is the solution adopted in KDE4 that could be perfect for Plasma too, see my attachment in Bug #346741.


Commented and watched, thanks for letting me know.
giok
Registered Member
Posts
11
Karma
0
OS

Re: lock after auto login

Tue Apr 18, 2017 6:27 pm
Very good.
This bug is one year old! Now we hope that someone solve it.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]