Repository navigation
Add optional idle.blank: power off the display without locking - #7863
Open
eugenefvdm wants to merge 2 commits into
Open
eugenefvdm wants to merge 2 commits into
eugenefvdm wants to merge 2 commits into
Conversation
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.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds optional idle-driven display blanking without locking, integrated with existing idle and lock services.
Changes:
- Adds
idle.blankscheduling, status, wake handling, and tests. - Adds a reusable
omarchy system blankcommand. - 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 | ||
| } |
|
|
||
| // 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") |
| 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. |
| 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.
Author
|
Addressed all 5 points from the Copilot review in f8f39fb:
New test cases cover the |
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Blanking the display has always been wired exclusively behind the session lock (
lock/Service.qml'sarmBlankTimer, only reachable frombeginLock()). 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(...)'viaomarchy-brightness-display off) already exist and work fine on their own.This adds a third, optional
idle.blankkey (seconds since idle began, alongside the existingscreensaver/lock) that independently blanks the display and keyboard backlight without requesting a lock:{ "version": 1, "idle": { "screensaver": 900, "blank": 1200, "lock": 86400 } }idle.blankkeeps today's behavior exactly — blanking stays tied to the lock, byte-for-byte the same as before.bin/omarchy-system-blankcommand (mirrors the existingomarchy-system-wake); the lock plugin's own blank step now calls it too, so there's one implementation instead of two duplicated inline commands.omarchy-system-wakepath).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
hypridlealongside it withidle.screensaver/idle.lockparked at a no-op value, which is exactly the kind of thingomarchy-shell's idle service is supposed to make unnecessary.Test plan
./test/cli— 116/116 pass./test/shell— same result as unmodifiedupstream/quattro(4 pre-existing environmental failures unrelated to this change, confirmed viagit stash); newidle-test.shcases forIdleModel.blankEnabledpassomarchy system --helplists the newblankcommand correctly under thesystemgroup🤖 Generated with Claude Code