nwg-piotr / nwg-shell-config

nwg-shell configuration utility
MIT License
67 stars 10 forks source link

nwg-lock behaves badly on system sleep #68

Closed nergdron closed 10 months ago

nergdron commented 10 months ago

I'm using nwg-shell-config 0.5.29-1 on Arch, running on hyprland. when I configure swayidle as follows, everything works correctly, my screen locks properly after the first timeout, goes to sleep after the second, and wakes from sleep after moving the mouse or pressing a button on the keyboard:

swayidle -w \
  timeout 30 "swaylock -f -i /path/to/wallpaper.jpg" \
  timeout 90 "systemctl suspend" &

however, if I use the nwg configuration for swaylock, setting the first timeout to 300 and the sleep timeout to 900, and the sleep command to systemctl suspend, I see the following in the process listing, and it behaves badly in the following way:

I'm not sure what nwg-lock is doing differently than swaylock, but it's super busted in my usage. I thought at first it might be related to the disabled monitor problems we saw with nwg-displays, but I've actually got my second and third outputs still mirrored, and nwg-displays still runs correctly, so I really don't have a clue.

any thoughts on how I could run this differently to figure out what's going wrong?

nwg-piotr commented 10 months ago

I observed a similar issue some time ago, but I can't make it happen any longer, at least on the machine at the office. Everything works as expected now. Will try again when I'm home.

nwg-piotr commented 10 months ago

-- Deleted as a wrong answer --

nwg-piotr commented 10 months ago

The reply above is probably incorrect. Need to do some more testing.

nwg-piotr commented 10 months ago

OK, the problem was that nwg-lock, before starting, would attempt to kill the running locker instance, which was:

  1. unnecessary (neither swaylock nor gtklock allow multiple instances);
  2. unsafe;
  3. leading to the red screen crash on the current swaylock version.

I deleted this part of code, together with some other obsolete stuff. I also removed gtklock from Hyprland settings, as it no longer works here.