Add a session-lock screen and idle management to the Hyprland-native subdirectory, enabled through the desktop aggregator. hyprlock draws through the compositor session-lock protocol, themed by Stylix, with a centered field and clock. Super+X locks directly through a guarded launch so the key works without the idle daemon. hypridle locks on idle and powers the displays off, with tunable timeouts, and locks before every suspend. Lid-close routes through logind to suspend, which the pre-sleep lock covers, so the lid lands at a locked screen.
2.8 KiB
spec, blocked-by
| spec | blocked-by |
|---|---|
| hyprland-desktop | 0021-desktop-group-and-hyprland-session |
What to build
A secure lock screen and idle management, so going idle, suspending, or closing the lid always lands at a locked screen.
Add hyprlock and hypridle modules in the Hyprland-native subdirectory of the desktop group, enabled through the aggregator.
hyprlock uses the compositor session-lock protocol so the lock surface is owned by the compositor and survives a locker crash.
hypridle is wired for lock-on-idle, screen-off, lock-before-suspend, and lid-close, with tunable timeouts.
Bind lock on Super+X.
Acceptance criteria
- hyprlock and hypridle modules exist in the Hyprland-native subdirectory and are enabled by the aggregator.
- hyprlock uses the compositor session-lock protocol.
- hypridle triggers lock-on-idle, screen-off, lock-before-suspend, and lid-close, with tunable timeouts.
- Lock is bound on
Super+X. - neogaia builds green under
nix flake check.
Implementation Notes
-
hyprlock is inherently the session-lock client. Criterion 2 needs no option: hyprlock draws its surface through the ext-session-lock protocol, so the compositor owns the surface and it survives a crash of the locker. The module therefore carries only geometry and behaviour.
-
Stylix themes the lock screen. Colors and the lock background come from Stylix's hyprlock target, which merges into the same
backgroundandinput-fieldblocks, so the module sets only field geometry and a$TIMElabel. -
lid-close is wired through logind, not a hypridle listener. hypridle cannot observe lid events, so the module sets
services.logind.settings.Login.HandleLidSwitch = "suspend", and the sharedbefore_sleep_cmdlocks ahead of the suspend. The lid therefore lands at a locked screen, satisfying the criterion by outcome even though the trigger is logind's. -
Super+Xis self-contained. The keybind execs a guarded hyprlock launch directly (pidof hyprlock || hyprlock) rather thanloginctl lock-session, so the lock key works whenever hyprlock is enabled, without depending on hypridle being the running lock handler. hypridle's own idle and suspend paths still funnel throughloginctl lock-sessionso logind tracks the locked state on those paths. -
Idle-suspend was left out. The spec enumerates lock-on-idle, screen-off, lock-before-suspend, and lid-close, so hypridle does not itself suspend on idle.
before_sleep_cmdhandles lock-before-suspend for the lid and any manual or externally configured suspend. Adding an idle-suspend stage is a reasonable future knob but was not requested here. -
One hyprlock package. Both the keybind and hypridle's
lock_cmdreferenceprograms.hyprlock.package, so the locker never splits versions between the two call sites.