xyb3rt / physlock

Lightweight linux console locking tool
GNU General Public License v2.0
303 stars 36 forks source link

Unable to unlock under some specific circumstances #67

Closed p-himik closed 6 years ago

p-himik commented 6 years ago

I use Awesome WM with keys set up as:

I also have /etc/systemd/system/physlock.service with

[Unit]
Description=Lock the screen on sleep
Before=sleep.target
Before=suspend.target
Before=hibernate.target
Before=hybrid-sleep.target

[Service]
ExecStart=/usr/local/bin/physlock -sm
ExecStartPost=/bin/sleep 1

[Install]
WantedBy=sleep.target
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target

Now, if I press ctrl+win+l, the screen is locked. If I then decide that I wanted to suspend instead and press ctrl+win+s without actually unlocking, nothing happens - just as it should be because physlock is still active and prevents (or at least, appears to prevent) the keypress from being handled. But I also lose the ability to unlock. The prompt with a text cursor is there, the cursor blinks on each key press, but there's no any other reaction when I hit Enter. The only remedy at this point is alt+sysrq+b.

xyb3rt commented 6 years ago

Physlock switches to another console so that none of your X keybinding do apply. The ctrl+win+s got interpreted as ctrl+s which suspends the terminal until you hit ctrl+q. I've disabled the flow control mechanism. Please note, that all uninterpreted control sequenses like ctrl+s are read from the console like ordinary characters and cause an authentication failure.

p-himik commented 6 years ago

Great, thank you!