Make the lock screen blank delay configurable - #7386
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a configurable lock-screen “blank after idle” timeout, defaulting to 5 seconds, and verifies the wiring via a shell-based Node test.
Changes:
- Read
idle.lockBlankfromshell.shellConfigin the lock screen QML and use it to drive the blank timer interval. - Add
idle.lockBlank: 5to the shippedconfig/omarchy/shell.jsondefaults. - Add a shell test that asserts the config key is referenced and the default remains 5 seconds.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test/shell.d/lock-blank-timeout-test.sh | Adds a regression test ensuring lockBlank config is referenced and default remains 5 seconds |
| shell/plugins/lock/Service.qml | Introduces blankTimeoutSeconds derived from config and uses it for idleBlankTimer.interval |
| config/omarchy/shell.json | Adds new default idle setting lockBlank: 5 |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| ) | ||
|
|
||
| assert( | ||
| /interval: root\.blankTimeoutSeconds \* 1000/.test(serviceQml), |
There was a problem hiding this comment.
Loosened the interval regex with whitespace tolerance and replaced the brittle ternary assertion with a check on the named default. Exact-source regexes are the pattern the other lock tests use, so the remaining assertions stay in that style.
| // Seconds the unlock screen stays lit without input before the display | ||
| // blanks, validated the same way the idle service reads its timeouts. | ||
| readonly property int blankTimeoutSeconds: { | ||
| var seconds = Number(idleConfig.lockBlank) | ||
| return isFinite(seconds) && seconds >= 0 ? Math.floor(seconds) : 5 |
There was a problem hiding this comment.
Named the fallback defaultBlankSeconds, mirroring defaultScreensaverSeconds/defaultLockSeconds in the idle service. The shipped JSON repeating the value is the existing pattern for screensaver and lock, and the test pins it on purpose so a default change is a conscious one.
| Timer { | ||
| id: idleBlankTimer | ||
| interval: 5000 | ||
| interval: root.blankTimeoutSeconds * 1000 |
There was a problem hiding this comment.
Kept the inline conversion: the idle service's timers use the same seconds * 1000 form, and the property comment above documents the unit.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (2)
shell/plugins/lock/Service.qml:25
- Using
Math.floor(seconds)can turn small positive values (e.g.,0.9) into0, which will make the timer interval0and likely blank immediately. Consider rounding instead (e.g.,Math.round) and/or clamping to a sensible minimum, or compute milliseconds directly (e.g., keep ablankTimeoutMsreal/int and setintervalfrom that) to avoid surprising truncation.
readonly property int blankTimeoutSeconds: {
var seconds = Number(idleConfig.lockBlank)
return isFinite(seconds) && seconds >= 0 ? Math.floor(seconds) : defaultBlankSeconds
}
test/shell.d/lock-blank-timeout-test.sh:8
pathis used but not required in this snippet. If the harness doesn’t reliably provide a globalpath, this test will fail; even if it does, explicitly addingconst path = require('path')will make the test self-contained and more robust.
const fs = require('fs')
const serviceQml = fs.readFileSync(path.join(root, 'shell/plugins/lock/Service.qml'), 'utf8')
const shellDefaults = JSON.parse(fs.readFileSync(path.join(root, 'config/omarchy/shell.json'), 'utf8'))
Summary
idle.lockBlankfrom shell.json for the seconds the unlock screen stays lit without input before the display blanksOpening the lid on a machine that locks before suspend gives you exactly 5 seconds of password prompt before the backlight drops. That is the right default, but on a desk with an external keyboard it can feel abrupt; this makes it a one-line config change instead of a fork of the lock service.
Verification
bash test/shell.d/lock-blank-timeout-test.shbash test/shell.d/lock-blank-fingerprint-test.shgit diff --check