

I recently finally configured my lockscreen again after switching to wayland. I’m using gtklock and so far it has been working really well. I’m using void linux with elogind installed, laptop suspends when closing the lid ootb. In order to trigger the lockscreen on suspend, i’m using a script placed in /etc/elogind/system-sleep, as described on the artix wiki
I haven’t tried swaylock unfortunately, gtklock is the first wayland screenlocker i tried. Before that i think i was using i3lock-color on xorg, which also worked fine as far as i can remember, but the problem with xorg screenlocking is that it isn’t actually very safe. Also, i’m not sure what distro you are using, but if it is a systemd distro there is probably a better way to trigger the screenlocker. I’m not sure if that script works in that case because it might be elogind specific. elogind is used on distros like artix and void because they don’t use systemd. Elogind is basically just the logind part ripped out of systemd.