i3 / i3lock

improved screen locker
https://i3wm.org/i3lock
BSD 3-Clause "New" or "Revised" License
921 stars 404 forks source link

Ensure people use xss-lock -l #207

Open stapelberg opened 5 years ago

stapelberg commented 5 years ago

When using xss-lock, the -l flag should be used so that the screen is locked before the machine is suspended. Otherwise, at least on some machines, there’s a race where users can interact with the running applications (e.g. enter “ls” into a terminal) before the screen is locked.

We should:

Airblader commented 5 years ago

In i3lock, check if the parent process is xss-lock

That sounds like a real hack(?)

stapelberg commented 5 years ago

Absolutely. But this is the best way I can think of to make users aware of this misconfiguration. If you have any other suggestions, let me know :)

Airblader commented 5 years ago

I'd probably question why xss-lock not only allows locking after suspension (is there a point to that?), but also why that is the default. I mean this doesn't just affect i3lock specifically, right?

stapelberg commented 5 years ago

The -l option enables readiness notifications, which must explicitly be supported by the locker. xss-lock can’t enable it by default without breaking all existing lockers that don’t support it.

I also can’t think of a way to re-design the protocol in such a way that it would negotiate with the locker whether readiness notifications are supported.

FrostKnight commented 4 years ago

Can there be an alternative for those who don't use systemd, such as slock built in capabilities or xautolock? and then obviously add it to the wiki? Would be very helpful! As it is now, xss-lock option is useless for gentoo users and other non-systemd users.

stapelberg commented 4 years ago

Let’s keep your discussion in https://github.com/i3/i3lock/issues/275 please.

ghost commented 1 year ago

xss-lock & xautolock are not an ideal solutions. Caz it doesn't allow screen saver blanking, doesn't allow inhibition, as well as blanking without locking. I recommend disabling all xscreen savers & manually setup xidlehook & xset dpms.

xset s off -dpms
exec --no-startup-id xidlehook \
--detect-sleep \
--not-when-audio \
--not-when-fullscreen \
--timer 180 'xset dpms force standby' '' \
--timer 180 'i3lock' '' \
--timer 360 'systemctl suspend' '' & 

Or if you wanna combine blanking as well as locking, you can do that. Just pipe i3lock & dpms standby in one timer. xidlehook supports infinite timers btw.

Lock possible on manual suspend too. bindsym <key> exec --no-startup-id i3lock | systemctl suspend

Also when you exit i3, make sure to kill xidlehook, since you don't wanna have multiple instances on re-login. bindsym <key> exec --no-startup-id pkill xidlehook | i3-msg exit