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

RFE: Delay asking for a password #50

Closed
gdamjan opened this issue Feb 10, 2019 · 19 comments
Closed

RFE: Delay asking for a password #50

gdamjan opened this issue Feb 10, 2019 · 19 comments

Comments

@gdamjan
Copy link

gdamjan commented Feb 10, 2019

most screen lockers these days have an option to delay the password requirement, so that if your locker activates you have 2-3 seconds to just press a button and get your screen back without typing the password.

@emersion
Copy link
Member

I bet this can be implemented with swayidle, or another client which would run swaylock after a timeout?

@gdamjan
Copy link
Author

gdamjan commented Feb 10, 2019

well if there was a passwordless swaylock that would work :)

or if there was a swaymsg "output * blank-and-keyboard-locked on" command ?

@emersion
Copy link
Member

I'd like not to implement this in swaylock/sway, since this can be implemented by a third-party client.

@gdamjan
Copy link
Author

gdamjan commented Feb 10, 2019

I'd like not to implement

would you be ok with someone else implementing it?

@emersion
Copy link
Member

Clarification: I'd like not to have this in swaylock/sway, since this can be implemented by a third-party client.

This means you can write the third-party client. ;)

@gdamjan
Copy link
Author

gdamjan commented Feb 10, 2019

I think that option is suboptimal, and probably error prone, but sigh

@gdamjan
Copy link
Author

gdamjan commented Feb 11, 2019

master...gdamjan:delay-password

there it is for anyone else

@snorkypie
Copy link

This should definitely be part of swaylock since we want to display (and abort) the actual lock screen. Feels like it would be a lot of work for a third party application to implement all of swaylocks display settings and render the exact same image before swaylock actually kicks in.

@emersion
Copy link
Member

Nah, just open a layer shell surface that spawns swaylock after a timeout.

@drrossum
Copy link

Nah, just open a layer shell surface that spawns swaylock after a timeout.

This sounds great. Can this easily be achieved with currently available tools?

@emersion
Copy link
Member

Could be a pretty simple C program.

@edrex
Copy link

edrex commented May 5, 2019

this should be default behavior imo not something users have to manually configure. the current behavior is a usability fail.

@ddevault
Copy link
Contributor

ddevault commented May 5, 2019

As the maintainer of the project, I disagree and will not be enabling this behavior by default.

@gdamjan
Copy link
Author

gdamjan commented May 5, 2019

As the maintainer of the project, I disagree and will not be enabling this behavior by default.

how about if it's optional? (my current branch has that)

@ddevault
Copy link
Contributor

ddevault commented May 5, 2019

I don't really like it. I think that it would be worth having a more featureful fork of swaylock out there which is more open to including features like that.

@emersion
Copy link
Member

emersion commented May 5, 2019

I feel like we've already discussed about that, @gdamjan.

@mortie
Copy link
Contributor

mortie commented Apr 23, 2020

Sorry for commenting on an ancient thread, but i think it's relevant (and, as #139 shows, people are still discussing it). I just merged gdamjan/swaylock:delay-password in to swaylock-effects: mortie@c0f6b94

@sh1boot
Copy link

sh1boot commented Aug 1, 2023

So I copied something like the following out of /etc/sway.conf:

exec swayidle -w \
         timeout 300 'swaylock -f -c 000000' \
         timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
         before-sleep 'swaylock -f -c 000000'

After reading this thread I decided the simplest thing to do was changed it thus:

exec swayidle -w \
         timeout 270 'notify-send -t 30000 "getting sleepy"' \
         timeout 300 'swaylock -f -c 000000' \
         timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
         before-sleep 'swaylock -f -c 000000'

I'm sure that'll work fine. I'm just too lazy to wait around to test it right now.

I think this works better than a grace period. If I see the notification then simply dismissing it is enough to reset the timeout, and in the mean time I can still see whatever I'm watching. And if I don't see the notification then it really doesn't matter what happens next.

@mensinda
Copy link

I wrote a manager script for swayidle / swaylock that manually handles the logic: https://gist.github.com/mensinda/94d0b05604bbb50f9b5bd4a5f1b48bfb

After finishing this script, a friend told me that swaylock-effects has this feature built in...

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

9 participants