Swaywm waking up to VC 7 (blank) instead of VC 8

I noticed that when suspending from sway on laptop lid closure, when I reopened the lid I would get a blank screen. I though something very wrong was happening, but then when I tried it with music playing I found that the music was still on, and I could switch VCs as normal (Fn+Ctrl+Super+Alt+F1…8). And I found sway happily running on VC 8.

How would I go about telling systemd to switch back to the VC I was in was before suspending?

I’m on nixos-20.09 and running linux-5.11.18 from kernel.org.

Bonus: locking every VC after suspend would be highly desirable.

services.physlock.enable = true;

magically fixes everything, and works for both xorg and wayland sessions out of the box. :grinning:

1 Like