the-cavalry / light-locker

A simple session-locker for lightdm
GNU General Public License v2.0
224 stars 22 forks source link

Allow configuration of the "session locked" screen delay #93

Open brentr opened 7 years ago

brentr commented 7 years ago

On our family desktop, multiple sessions remain open. We use <F7...12> to switch users quickly many takes during the day. The resulting hard coded 10 second delay light-locker enforces is annoying. This patch makes allows that delay to be configured for any number of seconds down to a minimum of 2. The default is 10. I've tried to implement this analogously to "lock-after-screensaver"

Tested on Debian unstable.

cavalier38 commented 7 years ago

Thank you for the patch, however it needs some changes.

Just wondering about your use case. If you switch using F7...F12, that means that you don't lock all the time? Meaning something you can switch quickly other times you would be redirected to the lock screen. Light-locker is intended that you use LightDM user switching, meaning you need to login to the other account every time you switch.

About the diff itself. The 10s delay is to explain the user what is happening. It isn't meant as a way to access the greeter. If a user uses F7...F12 alot, after the first couple of times, there is no need to explain it with a 10s delay. During this delay the user can switch screens again manually, the user isn't "force" to wait this time (referring to your the comment in ll-config.c). As in your use case you have this many times a day, I assume that when you get the greeter instead of the session you would understand what has happened. Why keep a minimum of 2s and not allow 0 to directly switch to the greeter, if that works for the user? The diff doesn't include the changes needed in apps.light-locker.gschema.xml.in.in and light-locker.1 I would like the command-line option and the settings to have the same name, in your patch "--wait" and "lock-wait". Also I think this name is too ambiguous, maybe something like "locked-message", open to suggestions.

It is a trivial patch, I'll merge it after the above changes. Will you make the changes? Otherwise I can take care of it.

brentr commented 7 years ago

Thanks for considering this. Yes, the fundamental problem is that light locker impedes switching between users logged in on different virtual terminals.

About the diff... The problem with switching manually is that one does not know which virtual terminal is being used by lightdm. I originally allowed reducing the delay to 0, but removing all delay seemed to result in a race condition. If you can make a delay of 0 work, that would be ideal! When the delay is set to zero, if the user needs to log in, they are taken directly to the login (or greeter) screen... It would be even better if they didn't have to retype or reselect their user name. When the user associated with the VT they originally tried to select is known, the greeter screen should reflect that.

In my opinion, there's no value to displaying the "this screen is locked message". How does a typical user even know which VT is running the light-dm greeter? Perhaps pressing any key on the "locked" screen could change immediately to the light-dm greeter?

The issues with gschema.xml* are beyond my understanding. Also, I think you are right in saying that --wait and --lock-wait are too ambiguous.

It would be much more efficient if you were to make the changes.

Peter de Ridder wrote:

Thank you for the patch, however it needs some changes.

Just wondering about your use case. If you switch using F7...F12, that means that you don't lock all the time? Meaning something you can switch quickly other times you would be redirected to the lock screen. Light-locker is intended that you use LightDM user switching, meaning you need to login to the other account every time you switch.

About the diff itself. The 10s delay is to explain the user what is happening. It isn't meant as a way to access the greeter. If a user uses F7...F12 alot, after the first couple of times, there is no need to explain it with a 10s delay. During this delay the user can switch screens again manually, the user isn't "force" to wait this time (referring to your the comment in ll-config.c). As in your use case you have this many times a day, I assume that when you get the greeter instead of the session you would understand what has happened. Why keep a minimum of 2s and not allow 0 to directly switch to the greeter, if that works for the user? The diff doesn't include the changes needed in apps.light-locker.gschema.xml.in.in and light-locker.1 I would like the command-line option and the settings to have the same name, in your patch "--wait" and "lock-wait". Also I think this name is too ambiguous, maybe something like "locked-message", open to suggestions.

It is a trivial patch, I'll merge it after the above changes. Will you make the changes? Otherwise I can take care of it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/the-cavalry/light-locker/pull/93#issuecomment-306204796, or mute the thread https://github.com/notifications/unsubscribe-auth/AADUxggPxSWFaabJgjuzSAD3MCgYWmHLks5sBBNNgaJpZM4LqfBJ.

-- Brent Roman MBARI Software Engineer Tel: (831) 775-1808 7700 Sandholdt Road Moss Landing, CA 95039 mailto:brent@mbari.org http://www.mbari.org/~brent

cavalier38 commented 7 years ago

Indeed, you don't know which VT LightDM uses, the same goes for knowing which sessions is in which VT. However, light-locker is meant to be used with lock sessions commands. For example bind Ctrl + Alt + L to light-locker-command -l and use that instead of Ctrl + Alt + F7. But that won't work if you want to switch between F1...F6.

Good that you told about the race, I guessed that would be the reason. I think I have solved it.

There is a command Switch To User, and also Lock would set the username. However, I don't think that is possible to change the username if the greeter has already spawn.

The message is shown, when the user did something we didn't intend. Or, if something unexpected happened. In the first case we try to discourage the user (not really neat). In the later it is good to inform the user something is happening.

For now I picked the name "locked-message", I'll give it another thought, maybe you can too.

foresto commented 6 years ago

I just upgraded to the latest xubuntu release, and found that light-locker still forces me to wait 10 seconds when switching between user sessions. The bug report I filed a year and a half ago (#94) was closed with no explanation other than a reference to this PR. Is there something blocking a fix here? I can't imagine that forcibly wasting users' time is intended behavior.

selurvedu commented 11 months ago

Please do something... Those 10 seconds are really painful.

stefanct commented 9 months ago

My hopes are low to see this soon integrated in any way but if anybody spends more time on this issue for my use case it would be great if the switch does (optionally) not happen at any predefined time but only once a key is pressed (or mouse cursor is moved). The reason is that I don't actually want to be redirected at all in the common use case but let a background application (blueproximity) determine my presence and call loginctl lock-session and loginctl unlock-session automatically in the background. As of now, whenever I am longer "away" than 10 seconds I have to login manually which is the main annoyance that makes me avoid locking my screen in the first place :)