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

Swaylock red screens or doesn't work with udev rules #323

Open
notmentaloutlaw opened this issue Oct 28, 2023 · 2 comments
Open

Swaylock red screens or doesn't work with udev rules #323

notmentaloutlaw opened this issue Oct 28, 2023 · 2 comments

Comments

@notmentaloutlaw
Copy link

When using a udev rule that triggers as I remove my yubikey I made it run a script that will trigger swaylock.

Here is that script:

#!/bin/sh
su - myuser -c "env WAYLAND_DISPLAY=wayland-1 XDG_RUNTIME_DIR=/run/user/1000 swaylock -c 00000000"

When I run that as root everything is fine and swaylock just works as normal. However when udev rules trigger that script sure swaylock opens but I can't get passed the lock screen the correct password does not work. Now if you had -f along with -c you will get another issue where after you type and press enter swaylock enters a red screen mode.

I am using swaylock 1.7.2 and I am on gentoo with openrc but I think this is reproducible in other distributions as well.

I am not sure what the root of the problem is but this would be a great if it does work.

@notmentaloutlaw
Copy link
Author

Just for context my 99-usb-remove.rules in /etc/udev/rules.d/ is

ENV{DEVTYPE}=="usb_device",
ACTION=="remove",
SUBSYSTEM=="usb",
ENV{idVendor}=="[redacted]",
ENV{idProduct}=="[redacted]",
RUN+="/path/to/script"

@mstoeckl
Copy link
Contributor

mstoeckl commented Jan 4, 2024

Now if you had -f along with -c you will get another issue where after you type and press enter swaylock enters a red screen mode.

I don't have any guesses as to why exactly the correct password is not working, but the red screen mode is something that Sway does when the lockscreen crashes, exits without unlocking, or makes a Wayland protocol error. Running with the --debug flag and looking at standard output/error, or checking if there was a core dump, will probably tell you which happened.

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

2 participants