Skip to content

Add optional idle.blank: power off the display without locking - #7863

Open
eugenefvdm wants to merge 2 commits into
omacom:quattrofrom
eugenefvdm:independent-idle-blank
Open

eugenefvdm wants to merge 2 commits into
omacom:quattrofrom
eugenefvdm:independent-idle-blank

Conversation

@eugenefvdm

Copy link
Copy Markdown

Summary

Blanking the display has always been wired exclusively behind the session lock (lock/Service.qml's armBlankTimer, only reachable from beginLock()). There's currently no way to turn the screen off on idle without also password-protecting the session — even though the pieces to do it independently (hyprctl dispatch 'hl.dsp.dpms(...)' via omarchy-brightness-display off) already exist and work fine on their own.

This adds a third, optional idle.blank key (seconds since idle began, alongside the existing screensaver/lock) that independently blanks the display and keyboard backlight without requesting a lock:

{
  "version": 1,
  "idle": {
    "screensaver": 900,
    "blank": 1200,
    "lock": 86400
  }
}
  • Omitting idle.blank keeps today's behavior exactly — blanking stays tied to the lock, byte-for-byte the same as before.
  • New bin/omarchy-system-blank command (mirrors the existing omarchy-system-wake); the lock plugin's own blank step now calls it too, so there's one implementation instead of two duplicated inline commands.
  • When lock is the earliest deadline, its own post-lock timer keeps owning the blank — the new idle-driven blank timer is skipped in that case so the two paths never race or double-fire.
  • Any input wakes the display the same way it already cancels the screensaver or an in-progress lock (reuses the existing omarchy-system-wake path).

Why

I hit this on my own machine wanting "screensaver at 15 min, display off at 20 min, no password lock" — a fairly common ask for a desktop that isn't shared. Today the only way to get there is bypassing the shell's idle system entirely and reinstalling hypridle alongside it with idle.screensaver/idle.lock parked at a no-op value, which is exactly the kind of thing omarchy-shell's idle service is supposed to make unnecessary.

Test plan

  • ./test/cli — 116/116 pass
  • ./test/shell — same result as unmodified upstream/quattro (4 pre-existing environmental failures unrelated to this change, confirmed via git stash); new idle-test.sh cases for IdleModel.blankEnabled pass
  • omarchy system --help lists the new blank command correctly under the system group
  • Manual verification in a running session (screensaver/blank/lock sequencing, wake-on-input) — happy to do this if a maintainer wants it before review, just flagging it wasn't run in the graphical acceptance VM

🤖 Generated with Claude Code

Blanking the display has always been wired exclusively behind the
session lock (lock/Service.qml armBlankTimer, only reachable from
beginLock). There is no way to turn the screen off on idle without
also password-protecting the session, even though `hyprctl dispatch
'hl.dsp.dpms(...)'` / omarchy-brightness-display off can do it on
their own.

Add a third, optional idle.blank key (seconds since idle began,
alongside screensaver/lock) that independently blanks the display and
keyboard backlight via a new omarchy-system-blank command, without
requesting a lock. Omitting the key keeps today's behavior exactly:
blanking stays tied to the lock. When lock fires first, its own
post-lock timer keeps owning the blank so the two paths never race.

New omarchy-system-blank also replaces the inline bash the lock
plugin used to blank, so both paths share one implementation.
Copilot AI balanced review requested due to automatic review settings August 23, 2026 07:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds optional idle-driven display blanking without locking, integrated with existing idle and lock services.

Changes:

  • Adds idle.blank scheduling, status, wake handling, and tests.
  • Adds a reusable omarchy system blank command.
  • Documents independent blanking behavior.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
bin/omarchy-system-blank Adds the display and keyboard blanking command.
docs/omarchy-shell.md Documents the optional configuration key.
manual/13-toggles-idle-screensaver.md Adds end-user blanking instructions.
shell/plugins/lock/Service.qml Reuses the new blank command.
shell/plugins/services/idle/IdleModel.js Adds blank configuration detection.
shell/plugins/services/idle/Service.qml Implements blank timing and lifecycle handling.
shell/plugins/services/idle/manifest.json Updates the service description.
test/shell.d/idle-test.sh Tests blank configuration detection.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +7 to +9
function blankEnabled(value) {
return value !== undefined && value !== null
}
Comment thread shell/plugins/services/idle/Service.qml Outdated

// When lock is the earliest deadline, its own post-lock timer already
// owns blanking (see lock/Service.qml armBlankTimer) -- don't race it.
if (root.blankConfigured && root.lockDelaySeconds !== 0) {
Comment on lines +74 to +75
function blankDisplay() {
runProcess(blankProcess, "blank", "[[ $(omarchy-shell lock isLocked 2>/dev/null) == \"true\" ]] || omarchy-system-blank")
Comment thread docs/omarchy-shell.md
First-party non-bar plugins are enabled unless listed in `disabledPlugins[]`.
6. `barWidget.allowMultiple: true` in the manifest permits multiple instances.
7. `idle.screensaver` and `idle.lock` are seconds since user idle began.
7. `idle.screensaver` and `idle.lock` are seconds since user idle began. `idle.blank` is optional and, when set, independently blanks the display (and keyboard backlight) at its own idle deadline without engaging the session lock — omit it to keep blanking tied to `idle.lock` as before.
Comment thread shell/plugins/services/idle/Service.qml Outdated
id: blankTimer
interval: root.blankDelaySeconds * 1000
repeat: false
onTriggered: if (root.idleEnabled && root.idledThisCycle) root.blankDisplay()
Addresses Copilot review feedback on omacom#7863:

- blankEnabled() accepted any non-null value, so an invalid config
  (e.g. "blank": "nope") fell through secondsFromConfig's fallback to
  a 0-second deadline instead of being rejected -- collapsing
  firstIdleTimeoutSeconds to 0 for the whole idle cycle. It now
  applies the same finite/non-negative check secondsFromConfig uses.
- The guard skipping the independent blank timer compared delays
  (lockDelaySeconds !== 0) rather than absolute deadlines, so
  blank === lock with an earlier screensaver deadline could still arm
  both timers with the same interval and race lock's own post-lock
  blank. Compare blankTimeoutSeconds < lockTimeoutSeconds instead.
- blankTimer's onTriggered didn't recheck blankConfigured, so removing
  idle.blank from shell.json while the timer was running (shell.json
  reloads live) could still fire a blank right after the setting was
  removed, since the interval binding drops to 0 on the same reload.
- shell/README.md duplicated the idle.screensaver/idle.lock rule
  without mentioning the new idle.blank key.

Verified live on a running omarchy-shell (cloned idle/lock plugins via
`omarchy plugin clone`): omarchy-system-blank/omarchy-system-wake
correctly toggle real DPMS state, and the patched service's computed
screensaver/lock/blank delays match expectations for a
screensaver=5/blank=10/lock=15 config. Full end-to-end timer-triggered
sequencing wasn't observed due to an unrelated idle-inhibit lock held
by another running app on that machine, pre-existing and independent
of this change.
@eugenefvdm

Copy link
Copy Markdown
Author

Addressed all 5 points from the Copilot review in f8f39fb:

  1. blankEnabled validation — now applies the same finite/non-negative check as secondsFromConfig, so an invalid idle.blank value is rejected instead of silently becoming a 0-second deadline.
  2. blank === lock race — the guard now compares absolute deadlines (blankTimeoutSeconds < lockTimeoutSeconds) instead of lockDelaySeconds !== 0, so it holds even when screensaver is the earliest deadline and blank/lock coincide.
  3. Visual verification — cloned the idle/lock plugins into a running omarchy-shell via omarchy plugin clone and confirmed omarchy-system-blank/omarchy-system-wake correctly toggle real monitor DPMS state, and that the patched service's computed screensaver/lock/blank delays are correct for a live config. I wasn't able to observe the full timer-triggered sequence end-to-end — an idle-inhibit lock held by an unrelated running app on that machine (pre-existing, unrelated to this change) kept the compositor from ever reporting idle during the test window.
  4. Stale shell/README.md reference — updated its duplicated idle rules list to document idle.blank.
  5. Hot-reload race on blankTimer — onTriggered now rechecks blankConfigured, so removing idle.blank from shell.json mid-countdown can no longer fire a stray blank.

New test cases cover the blankEnabled validation fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants