Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add grace period for the screen locker #143

Closed
tpircher-zz opened this issue Jun 8, 2020 · 11 comments
Closed

Add grace period for the screen locker #143

tpircher-zz opened this issue Jun 8, 2020 · 11 comments

Comments

@tpircher-zz
Copy link

Please consider a grace period for the screen locker, similar to the lockTimeout setting in xscreensaver. This allows for a certain amount of time to exit the screen lock without having to type in the password.
One example where this may be useful is when watching a video or when in a conf call, when mouse and keyboard are idle for a longer period, but the screen should be visible. In that case, wiggling the mouse is much less intrusive than having to type in the password.

The xscreensaver option is documented as:

lockTimeout (class Time)
If locking is enabled, this controls the length of the ''grace period'' between when the screensaver activates, and when the screen becomes locked. For example, if this is 5, and -timeout is 10, then after 10 minutes, the screen would blank. If there was user activity at 12 minutes, no password would be required to un-blank the screen. But, if there was user activity at 15 minutes or later (that is, -lock-timeout minutes after activation) then a password would be required. The default is 0, meaning that if locking is enabled, then a password will be required as soon as the screen blanks.

@mortie
Copy link
Contributor

mortie commented Jun 15, 2020

This has already been discussed and rejected: #58, #50.

If you want a grace period option, you can check out my own swaylock-effects where I merged (a modified version of) the --grace option suggested by gdamjan: mortie@c0f6b94

@shibe2
Copy link

shibe2 commented Jul 13, 2020

when mouse and keyboard are idle for a longer period

swaylock doesn't monitor mouse and keyboard, some other program does it. What you want is a warning when the screen is about to be locked because of inactivity. That program which monitors user activity should give you a warning before starting swaylock. Then this grace feature doesn't need to be in swaylock.

when watching a video

Ideally, the screen shouldn't be locked at all while you are watching a video. Again, the program that monitors user activity should deal with it.

xscreensaver option

XScreenSaver does both activity monitoring and screen locking, so naturally it has all the relevant timeout options.

@532910
Copy link

532910 commented Aug 16, 2020

swaylock doesn't monitor mouse and keyboard

it must not monitor mouse and keyboard for grace period

What you want is a warning when the screen is about to be locked because of inactivity.

No warning must be shown. Just a timeout before lock.

@shibe2
Copy link

shibe2 commented Aug 16, 2020

No warning must be shown. Just a timeout before lock.

By "warning" I mean some kind of indication, not necessarily a warning message. What you want to happen when there is no user input is the following:

  1. The screen is on and shows what you want to watch.
  2. After some time the screen goes blank or off – this is one possible warning that I'm talking about.
  3. After some more time the screen is locked; i.e. requires entering a password.

Swaylock is started at the step 3, and it does what needs to be done at that step.

What's suggested in this feature request is that swaylock would be started at step 2 and handle things from there. I argue that it's not necessary to achieve the desired functionality. Screen blanking can be done with swaymsg, for example.

I also think that blanking the screen is not the best option for step 2. When you are looking at the screen, you don't want it to suddenly go blank. You want to know when it's about to go blank and prevent that from happening. For example, where screen brightness can be changed programmatically, it's often reduced as a warning before going completely blank.

And as I already said, when you are watching something, or in a video call, you don't want it to go even to step 2. This case should be automatically detected (but with possibility to trigger it manually) and screen blanking and locking should be avoided.

It's possible to make a program that would handle all screen blanking and locking functions, and it's possible to build this functionality into a compositor/shell. But I think that swaylock was not meant to be this kind of program. Instead, its scope is narrow, and it can be used as a building block for a complete solution.

@532910
Copy link

532910 commented Aug 17, 2020

Screen blanking can be done with swaymsg, for example.

agree

blanking the screen is not the best option for step 2

disagree, blanking the screen is the most notable "warning" when you are not looking at the monitor

@532910
Copy link

532910 commented Aug 17, 2020

swaywm/sway#5628

@apiraino
Copy link

apiraino commented Nov 4, 2020

Folks, I think what is being discussed here is a "presentation mode" that temporarily inhibits any power saving / locking feature. It's included in Waybar, in case someone is using it (personally not tested).

@shibe2
Copy link

shibe2 commented Nov 5, 2020

@apiraino Did you mean Waybar? Swaybar is here: https://github.com/swaywm/sway/tree/master/swaybar

@apiraino
Copy link

apiraino commented Nov 5, 2020

@shibe2 ... you're right 😅

(fixed my link above)

@emersion
Copy link
Member

emersion commented Jun 8, 2021

This was already discussed in the past, and I'd rather not add this feature. Please consider contributing to a fork such as swaylock-effects if they are interested.

Alternatively, maybe this could be implemented as a separate client, which uses the idle Wayland protocol and starts swaylock after a idle delay.

@emersion
Copy link
Member

This small client may be used to implement a grace period: https://git.sr.ht/~emersion/chayang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants