feat(desktop): add hyprlock and hypridle (task 0026) #18

Merged
alexion merged 1 commits from task-0026-hyprlock-and-hypridle into main 2026-07-22 18:58:17 -04:00
Owner

Task: .claude/tasks/0026-hyprlock-and-hypridle.md

Summary

Adds a session-lock screen and idle management to the Hyprland-native subdirectory of the desktop group, enabled through the aggregator.

  • hyprlock draws through the compositor session-lock protocol, so the compositor owns the surface and it survives a locker crash. Themed by Stylix (colors + background); the module sets only field geometry and a $TIME clock. Super+X locks.
  • hypridle locks on idle and powers the displays off, with tunable lockTimeout / screenOffTimeout options, and locks before every suspend via before_sleep_cmd. Lid-close routes through services.logind → suspend, which the pre-sleep lock covers, so the lid lands at a locked screen.

Deviations (see ## Implementation Notes in the task file):

  • Super+X is self-contained — it execs a guarded hyprlock launch directly rather than loginctl lock-session, so the lock key works whenever hyprlock is enabled, independent of hypridle. hypridle's own idle/suspend paths still funnel through loginctl lock-session so logind tracks locked state there.
  • lid-close is wired through logind, not a hypridle listener — hypridle cannot observe lid events, so the criterion is met by outcome (lid → suspend → pre-sleep lock).
  • Idle-suspend was left out — the spec enumerates lock-on-idle, screen-off, lock-before-suspend, and lid-close; hypridle does not itself suspend on idle. A future knob if wanted.

Review

Risk

Overall: Medium

  • Blast radius: Low — new modules behind their own enable flags; no existing callers touched.
  • Reversibility: Low — pure config addition, no migrations; revert-and-rebuild undoes it.
  • Test coverage: Medium — no automated proof a lock engages; confirmation is manual per the spec.
  • Sensitive domain: Medium — the session lock/idle-security surface, but declarative and self-contained.
  • Size & complexity: Low — two small option modules plus three config lines.
  • Runtime criticality: Medium — governs whether an unattended machine actually locks.

Standards

No unaddressed findings. The review's two hard findings (cross-file narration in the bind comment; a multi-line file-top header) and the version-split design smell (hyprlock hardcoded from pkgs in two places) were all fixed in the diff.

Spec

  • lid-close mechanism (accepted deviation) — the criterion names hypridle as the trigger, but the lid is handled by services.logind; hypridle genuinely cannot observe lid events, so the outcome (locked screen on lid-close) is met by the correct available mechanism.

— Claude

Task: `.claude/tasks/0026-hyprlock-and-hypridle.md` ## Summary Adds a session-lock screen and idle management to the Hyprland-native subdirectory of the desktop group, enabled through the aggregator. - **hyprlock** draws through the compositor session-lock protocol, so the compositor owns the surface and it survives a locker crash. Themed by Stylix (colors + background); the module sets only field geometry and a `$TIME` clock. `Super+X` locks. - **hypridle** locks on idle and powers the displays off, with tunable `lockTimeout` / `screenOffTimeout` options, and locks before every suspend via `before_sleep_cmd`. Lid-close routes through `services.logind` → suspend, which the pre-sleep lock covers, so the lid lands at a locked screen. Deviations (see `## Implementation Notes` in the task file): - **`Super+X` is self-contained** — it execs a guarded hyprlock launch directly rather than `loginctl lock-session`, so the lock key works whenever hyprlock is enabled, independent of hypridle. hypridle's own idle/suspend paths still funnel through `loginctl lock-session` so logind tracks locked state there. - **lid-close is wired through logind, not a hypridle listener** — hypridle cannot observe lid events, so the criterion is met by outcome (lid → suspend → pre-sleep lock). - **Idle-suspend was left out** — the spec enumerates lock-on-idle, screen-off, lock-before-suspend, and lid-close; hypridle does not itself suspend on idle. A future knob if wanted. ## Review ### Risk **Overall: Medium** - Blast radius: Low — new modules behind their own enable flags; no existing callers touched. - Reversibility: Low — pure config addition, no migrations; revert-and-rebuild undoes it. - Test coverage: Medium — no automated proof a lock engages; confirmation is manual per the spec. - Sensitive domain: Medium — the session lock/idle-security surface, but declarative and self-contained. - Size & complexity: Low — two small option modules plus three config lines. - Runtime criticality: Medium — governs whether an unattended machine actually locks. ### Standards No unaddressed findings. The review's two hard findings (cross-file narration in the bind comment; a multi-line file-top header) and the version-split design smell (hyprlock hardcoded from `pkgs` in two places) were all fixed in the diff. ### Spec - **lid-close mechanism (accepted deviation)** — the criterion names hypridle as the trigger, but the lid is handled by `services.logind`; hypridle genuinely cannot observe lid events, so the outcome (locked screen on lid-close) is met by the correct available mechanism. — Claude
alexion added 1 commit 2026-07-22 18:38:22 -04:00
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.
alexion merged commit 005928ef88 into main 2026-07-22 18:58:17 -04:00
alexion deleted branch task-0026-hyprlock-and-hypridle 2026-07-22 18:58:18 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: alexion/dotfiles#18