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

Hyprlock fingerprint not working after idle #531

Open
kito30 opened this issue Oct 27, 2024 · 13 comments
Open

Hyprlock fingerprint not working after idle #531

kito30 opened this issue Oct 27, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@kito30
Copy link

kito30 commented Oct 27, 2024

Regression?

No

Hyprlock Info and Version

Hyprlock version 0.5.0

Hyprlock config
source = ~/.cache/wal/hyprcolors.conf

# Fonts
$font = azuki_font
$clockFont = azuki_font
$minimalFont = azuki_font

general {
    disable_loading_bar = true 
    hide_cursor = false
    ignore_empty_input = true
    enable_fingerprint = true
}

background {
    monitor =
    path = $wallpaper
    blur_passes = 2
    blur_size = 5
    color = $background
    noise = 0.0117
    contrast = 0.8916
    brightness = 0.8172
    vibrancy = 0.1696
    vibrancy_darkness = 0.0
}

# Time
label {
    monitor =
    text = $TIME
    color = $foreground
    font_size = 120
    font_family = $clockFont
    position = 0, -60
    halign = center
    valign = top
}

# Date
label {
    monitor = 
    text = cmd[update:43200000] echo -e "$(date +"%A, %d %B %Y")"
    color = $foreground
    font_size = 20
    font_family = $font
    position = 0, -250
    halign = center
    valign = top
}

# Logged user
label {
    monitor = 
    font_size = 30
    font_family = $minimalFont
    color = $foreground
    text = I major in computer science
    halign = center
    valign = bottom
    position = 0, 300
}

# Avatar
image {
    monitor = 
    path = ~../OneDrive_Kito/animepic/314451413_174893565204253_5759314398642999570_n.jpg
    size = 150
    rounding = 100
    border_color = $color2
    position = 0, 50
    halign = center
    valign = center
}

# Input (password)
input-field {
    monitor =
    size = 200, 50
    outline_thickness = 3
    dots_size = .15
    dots_spacing = .6
    dots_center = true
    outer_color = $background
    inner_color = $color3
    font_color = $foreground
    fade_on_empty = false
    placeholder_text = 
    hide_input = false
    check_color = $color4
    fail_color = $color1
    fail_text = <i>$FAIL <b>($ATTEMPTS)</b></i>
    capslock_color = $color1
    position = 0, 400
    halign = center
    valign = bottom
    capslock_color = rgb(255,0,0)
    numlock_color = rgb(255,0,0)
}

Compositor Info and Version

System/Version info
Hyprland, built from branch  at commit 4520b30d498daca8079365bdb909a8dea38e8d55  (version: bump to 0.44.1).
Date: Wed Oct 9 12:54:39 2024
Tag: v0.44.1, commits: 5309
built against aquamarine 0.4.3


flags: (if any)


System Information:
System name: Linux
Node name: Kito
Release: 6.11.5-arch1-1
Version: #1 SMP PREEMPT_DYNAMIC Tue, 22 Oct 2024 18:31:38 +0000


GPU information: 
00:02.0 VGA compatible controller [0300]: Intel Corporation UHD Graphics 620 [8086:5917] (rev 07) (prog-if 00 [VGA controller])


os-release: NAME="EndeavourOS"
PRETTY_NAME="EndeavourOS"
ID="endeavouros"
ID_LIKE="arch"
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://endeavouros.com"
DOCUMENTATION_URL="https://discovery.endeavouros.com"
SUPPORT_URL="https://forum.endeavouros.com"
BUG_REPORT_URL="https://forum.endeavouros.com/c/general-system/endeavouros-installation"
PRIVACY_POLICY_URL="https://endeavouros.com/privacy-policy-2"
LOGO="endeavouros"


plugins:
  split-monitor-workspaces by Duckonaut ver 1.2.0```

</details>

### Description

When not sleeping the fingerprint works fine. When sleep and wake up, the fingerprint could not be use to open the hyprlock anymore.

### How to reproduce

Sleep, wake up. Couldnt unlock hyprlock with fingerprint.

### Crash reports, logs, images, videos

_No response_
@kito30 kito30 added the bug Something isn't working label Oct 27, 2024
@PaideiaDilemma
Copy link
Contributor

0.5.0 introduced fingerprint support outside of pam, since that does not work well in a lot of cases.
This comment might help you: #258 (comment)

@kito30 kito30 changed the title Hyprlock fingerprint not working after swa Hyprlock fingerprint not working after idle Oct 27, 2024
@kito30
Copy link
Author

kito30 commented Oct 27, 2024

does not seems to find anything usefull for this case

@PaideiaDilemma
Copy link
Contributor

nevermind. because the formatting is broken i did not bother to check your config and see that you are already using the new fingerprint support.

Can you post hyprlock logs from when that happens?
It should log fprintd: PrepareForSleep.. when you start sleep and wake.

@kito30
Copy link
Author

kito30 commented Oct 27, 2024

How do I get the log, and im also using python-validity for the fingerprint.

@PaideiaDilemma
Copy link
Contributor

@kito30
Copy link
Author

kito30 commented Oct 28, 2024

Yup try that, the service just turn off when sleep. Maybe its a issues with the validity. Im gonna close it for now.

@kito30 kito30 closed this as completed Oct 28, 2024
@DragonHunter274
Copy link

Can this be reopened?
The service not restarting after sleep can be fixed easily (see python-validity repo), but hyprlock still doesn't work when the service is enabled.
When hyprlock tries to enable the fingerprint reader, it hasn't finished initializing yet so fprintd fails.
I'm not sure if python-validity or open-fprintd sends a signal if the reader is initialized after sleep.
maybe a configurable delay before activating the fingerprint reader or a few retries if it errors could be a fix.

@kito30 kito30 reopened this Nov 4, 2024
@PaideiaDilemma
Copy link
Contributor

does #544 change anything?

@PaideiaDilemma
Copy link
Contributor

this really sounds like a open-fprintd problem

@DragonHunter274
Copy link

This is the error I get:

  File "/nix/store/kskcvgz5jgc9158p9p99lh7fwc14mcrh-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/service.py", line 715, in _message_cb
    retval = candidate_method(self, *args, **keywords)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/jnba21llh7q358cwkqccr2lnixkbpska-python3.11-python-validity-0.14/bin/.python-validity-dbus-service-wrapped", line 110, in VerifyStart
    usr = self.user2record(user)
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/jnba21llh7q358cwkqccr2lnixkbpska-python3.11-python-validity-0.14/bin/.python-validity-dbus-service-wrapped", line 65, in user2record
    return db.lookup_user(self.user2identity(user))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/jnba21llh7q358cwkqccr2lnixkbpska-python3.11-python-validity-0.14/lib/python3.11/site-packages/validitysensor/db.py", line 163, in lookup_user
    stg = self.get_user_storage(name='StgWindsor')
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/jnba21llh7q358cwkqccr2lnixkbpska-python3.11-python-validity-0.14/lib/python3.11/site-packages/validitysensor/db.py", line 149, in get_user_storage
    return parse_user_storage(tls.cmd(pack('<BHH', 0x4b, dbid, len(name)) + name))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/jnba21llh7q358cwkqccr2lnixkbpska-python3.11-python-validity-0.14/lib/python3.11/site-packages/validitysensor/tls.py", line 122, in cmd
    rsp = self.app(cmd)
          ^^^^^^^^^^^^^
  File "/nix/store/jnba21llh7q358cwkqccr2lnixkbpska-python3.11-python-validity-0.14/lib/python3.11/site-packages/validitysensor/tls.py", line 152, in app
    return self.parse_tls_response(self.usb.cmd(self.make_app_data(b)))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/jnba21llh7q358cwkqccr2lnixkbpska-python3.11-python-validity-0.14/lib/python3.11/site-packages/validitysensor/tls.py", line 351, in parse_tls_response
    raise Exception('Unexpected TLS version %d %d' % (mj, mn))
Exception: Unexpected TLS version 4 0

it is supposed to be fixed in python-validity 0.14 but doesnt work for me
see also: uunicorn/python-validity#127

@DragonHunter274
Copy link

DragonHunter274 commented Nov 4, 2024

does #544 change anything?

I run nixos and I'm not sure how I set the hyprlock package to the pr version
EDIT: figured it out, PR is building

EDIT2: the PR didn't change anything unfortunately

@DragonHunter274
Copy link

I can now confirm that the problem is, python-validity takes too long to reset the reader after resume.
this is my PoC "fix", not having touched c++ ever before

    try {
        auto finger = "any"; // Any finger.
        m_sDBUSState.device->callMethod("VerifyStart").onInterface(DEVICE).withArguments(finger);
    } catch (sdbus::Error& e) {
        Debug::log(WARN, "fprint: could not start verifying, {}", e.what());
        try {
        auto finger = "any";
        std::this_thread::sleep_for(std::chrono::milliseconds(100));
        m_sDBUSState.device->callMethod("VerifyStart").onInterface(DEVICE).withArguments(finger);
      } catch (sdbus::Error& e) {
        Debug::log(WARN, "fprint: could not start verifying, {}", e.what());

        return false;
}

@Filz0r
Copy link

Filz0r commented Nov 7, 2024

Hello I'm also having an issue related to this one, but with a huge twist, I'm using python3-validity like other users in this thread but in my case the finger print sensor requires an extra hack that is defined in here, the hack works with something like swaylock, but on hyprlock it doesn't work that well, on swaylock it took like 2 seconds for the sensor to be active again, but on hyprlock it only gets active after I input the password, I'm also using a label to print the fprintd status and when the system resumes this status message is empty. here is my general config on hyprlock:

general {
    enable_fingerprint = true
    fingerprint_ready_message = Slap yo finger
    fingerprint_present_message = Scanning...
}

The Slap yo finger message never appears after a resume, which is kinda expected because the sensor isn't working for the first second or two, however what I can't wrap my head about is the reasoning why I have to input both my password and fingerprint after a system resume, my /etc/pam.d/hyprlock has the default values and my /etc/pam.d/system-local-login looks like this:

#%PAM-1.0

auth      sufficient pam_fprintd.so
auth      include   system-login
account   include   system-login
password  include   system-login
session   include   system-login

I don't know if this is an issue on my configuration but it doesn't seem like it, it seems like python3-validity doesn't really like the integration with hyprlock based on this thread. If anyone has any ideas on how to further debug this let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants