While this issue may be related to https://github.com/swaywm/sway/issues/2743 I have a feeling it's not the same issue.
My password is never accepted by swaylock (not just sometimes). It seems to be because I have a capital letter in my password and so I need to use the shift key to enter it. When I press shift, the indicator reacts to it by becoming the same green color all over, so it seems to do "something" when I just press shift.
This happens regardless of whether I run swaylock through swayidle or just directly from the command line like swaylock -c 000000.
Using sway at commit https://github.com/swaywm/sway/commit/5d21c33f13f34ed592388512cc092986324c8f35 (tip of master atm).
Everyoneâ„¢ have capital letters in their password, and it works for me ; you'll have to do some debugging (the ring is cleared when shift is pressed, as you describe)
If you don't mind dispaying your password, a simple thing to try would be to make swaylock just print your password to stdout before trying to unlock, then run swaylock manually from a term, enter password once, switch tty to kill swaylock then go back to the terminal to see what was printed
What OS are you using?
@martinetd Did as you suggested and debugged swaylock - it does get the correct password, which lead me to look elsewhere and ofc it's all my fault - bad/missing pam config. I've been running sway directly from a clone without ever thinking of pam. @SirCmpwn I'm running NixOS. So the fix in my case was really simple - in /etc/nixos/configuration.nix:
security.pam.services.swaylock = {
text = ''
auth include login
'';
};
Then rebuild the os conf.
@johnae just a heads up, there is a program wrapper for sway. I have a slimmed down version I'm using successfully with the latest commits as well: https://github.com/colemickens/nixpkgs/blob/3a7df52cf34cad742a943b4eb0644db8d0aa47a4/nixos/modules/programs/sway.nix (the sway/wlroots/meson packages are in sway-wip branch).
It has a more minimal pam config than you have here, but it seems to work for me.
Thanks @colemickens that's very useful.
@colemickens is this in nixpkgs now?
Most helpful comment
@martinetd Did as you suggested and debugged swaylock - it does get the correct password, which lead me to look elsewhere and ofc it's all my fault - bad/missing pam config. I've been running sway directly from a clone without ever thinking of pam. @SirCmpwn I'm running NixOS. So the fix in my case was really simple - in /etc/nixos/configuration.nix:
Then rebuild the os conf.