noctalia-shell icon indicating copy to clipboard operation
noctalia-shell copied to clipboard

[BUG] Lock screen stopped working when closing laptop lid on Latest Noctalia Shell

Open JustinWayland opened this issue 5 months ago • 9 comments

Submission checklist

  • [x] I have searched existing issues and confirmed this is not a duplicate.
  • [x] I am using the latest available version of Noctalia.

Bug description

The lock screen stopped popping up upon closing the lid on the latest Noctalia Shell.

Steps to reproduce

  1. Log into Niri using Noctalia Shell.
  2. Enable the lockscreen.
  3. Close the laptop lid.
  4. Open the lid again.

Expected behavior

The lockscreen pops up upon opening up the laptop lid.

Actual behavior

The lockscreen does not show up. The session can be used straight away.

Logs / error output

<details>
[irrelevant details omitted]
2026-06-22 15:40:41.967 [DBG] [clipboard] clipboard history size=352668 entries=5 latest_mime=text/plain
2026-06-22 15:41:24.892 [DBG] [system_bus] single event dispatch took 69.0ms
2026-06-22 15:41:24.892 [DBG] [main] poll source 19SystemBusPollSource dispatch took 69.1ms
2026-06-22 15:41:29.199 [INF] [app] system resumed; rechecking night light schedule
</details>

Noctalia version

50bb514a8e8f

Compositor

Niri

Distribution

Arch-based

Environment information

Installation: AUR
Laptop: Framework 16
GPU: Radeon 780M

Additional context

Can be worked around if swayidle is installed using swayidle before-sleep "noctalia msg session lock"

JustinWayland avatar Jun 22 '26 19:06 JustinWayland

Same issue here on niri 26.04 (NixOS), reproducible. Workaround with swayidle -w before-sleep "noctalia msg session lock" works. Noctalia version: efb96e41.

NewSunH avatar Jun 24 '26 03:06 NewSunH

you can also with niri in kdl config

switch-events {
    lid-close {
        spawn "noctalia" "msg" "session" "lock"
    }
}

xdenotte avatar Jun 24 '26 11:06 xdenotte

I use switch-events in Niri but it does not work reliably. I have noticed that when I open the lid, I will often see my desktop and then after sec or two my screen locks. If you have document open, someone could read potentially confidential information and device is completely usable before screen locks.

I have tried to look int this behaviour and apparently Niri's switch-events and systemd-logind do not work together but rather work independent of each other. Laptop will suspend directly when lid is closed, with or without 'switch-events' and occasionally before lock command can run.

Is it possible to make Noctalia idle to delay inhibitor lock from logind like Swaylock or Hypridle does? That would give time for lockscreen command to run.

I run NixOS and have installed Noctalia v5 via flake. Laptop is Framework 13 with Ryzen 7640U with Radeon 760M.

benicd avatar Jul 19 '26 12:07 benicd

Hey there, I recently pushed a commit 794b116 that might help with it (works similar to hypridle etc). Would love some feedback @JustinWayland @NewSunH @dorjanbenic :)

Ly-sec avatar Jul 29 '26 13:07 Ly-sec

After two days and many times opening and closing a laptop lid, I did not reproduce the issue again. Seems to be resolved.

benicd avatar Jul 31 '26 14:07 benicd

+1 it was fixed with the recent beta

rogervn avatar Jul 31 '26 19:07 rogervn

~~@rogervn can you give me a specific commit of when this is fixed? i have build Noctalia against cachix branch today (which is up to date with main) on NixOS but it did not take any effect. Have I missed any toggles?~~

EDIT: I restarted Noctalia and it works now, nvm

MorningMC avatar Aug 05 '26 13:08 MorningMC

After repeated testing, I found that the issue has been resolved. Perhaps we can close the issue now.

Qaaxaap avatar Aug 07 '26 12:08 Qaaxaap

@ItsLemmy you can close this one too

Yocraft-2000 avatar Aug 16 '26 23:08 Yocraft-2000