-
Notifications
You must be signed in to change notification settings - Fork 403
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
Fingerprint unlock after suspend/sleep with fprintd and PAM does not work #210
Comments
I don’t have a fingerprint reader, so I can’t look into this. I don’t know what would be different after suspend/resume, though. Try checking the PAM logs? i3lock just uses PAM, it doesn’t know about fingerprint readers. |
@ddnomad do you find any workaround or more information? I've same exact issue. Fingerprint is working great when lauching i3lock manually but not after |
@kakawait I've decided to get rid of fingerprint PAM module completely on my machine. This and other issues were causing to much grief. I've narrowed it down to PAM kicking in before the dkms module for a fingerprint loads hence PAM assumes this auth method fails. |
I'm interested in this feature working correctly as well, so I looked into it. There's a bug report open for PAM on this issue: linux-pam/linux-pam#301 |
I've sort of managed to get it to work. I tried piping the output of the fprintd-verify into a file to view the log. It was outputting
The arch wiki has an example for restricting fprintd fprint#Restrict_enrolling which I essentially modified to allow anybody to use fprintd-verify. That way when the systemd service tries to use fprintd-verify it wouldn't have to be authorized. /usr/share/polkit-1/rules.d/50-net.reactivated.fprint.device.verify.rules
And that somehow made it work. There is probably a better solution to this, but this works for now. Also, if anyone is curious, here are other files related to my setup: gist |
On further investigation, I realized the reason it only works after pressing enter is because after you press enter it enters the verifying mode. Once in the verifying mode it doesn't let you type password anymore. So simply starting the verification mode automatically probably isn't a good solution for most. Like @Jaegrqualm said, two PAM sessions are probably necessary for complete support. |
Found a workaround where I could use either password or fingerprint reader. With xss-lock I needed to add this systemd service in order to delay suspend until i3lock starts.
The script: #!/bin/sh
if ! pidof i3lock; then
scrot -o /tmp/screenshot.png
convert /tmp/screenshot.png -blur 0x5 /tmp/screenshot.png
# Turn on DND
old="$(xfconf-query -c xfce4-notifyd -p /do-not-disturb)"
xfconf-query -c xfce4-notifyd -p /do-not-disturb -s true
# Pause stuff and mute audio
playerctl -a pause > /dev/null
aold="$(amixer get Master | tail -2 | grep '\[on\]')"
amixer set Master mute > /dev/null
i3lock -ui /tmp/screenshot.png
while pidof i3lock > /dev/null; do
if (timeout 5 fprintd-verify | grep -q verify-match); then
pkill i3lock
fi
done
# Set settings back to what they were before
if ! [ -z "$aold" ]; then
amixer set Master unmute > /dev/null
fi
xfconf-query -c xfce4-notifyd -p /do-not-disturb -s $old
fi |
I think you can use xss-lock’s |
Oh, thanks! I updated the gist with a script that works. |
This is very specific scenario of just locking and unlocking the DE/WM, is there a generic method that works with sudo (and if possible also polkit authentication) too at time of any cli/app to have a superuser acquisition? |
The point of the ticket was unlocking i3lock. Getting sudo working is outside the scope of i3wm and i3lock. You can get sudo working with fprintd fairly easily -- https://wiki.archlinux.org/title/fprint |
I’m closing this issue in favor of tracking all PAM improvement work (which will help with fingerprint readers and other setups) in issue #217 |
I'm submitting a…
Current Behavior
I'm using
fprintd
to unlock my laptop (Lenovo X250) with fingerprint. Usingi3lock
for this works fine all the time except for when I attempt to authenticate againsti3lock
after getting from suspend/sleep.This issue is similar to this one.
Relevant pieces of configuration:
/etc/pam.d/i3lock
/etc/systemd/system/suspend@service
/usr/bin/lock_screen
Expected Behavior
I can trigger fingerprint authentication pressing Enter after suspend/sleep (using i3lock) and authenticate successfully without entering password.
Reproduction Instructions
Just save the above configuration files in your system and suspend the laptop. Do not forget to enable
suspend@$USER.service
.Environment
Output of
i3lock --version
:The text was updated successfully, but these errors were encountered: