Skip to content

Make the lock screen blank delay configurable - #7386

Open
crmne wants to merge 2 commits into
basecamp:quattrofrom
crmne:cp/lock-blank-timeout
Open

Make the lock screen blank delay configurable#7386
crmne wants to merge 2 commits into
basecamp:quattrofrom
crmne:cp/lock-blank-timeout

Conversation

@crmne

@crmne crmne commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • read idle.lockBlank from shell.json for the seconds the unlock screen stays lit without input before the display blanks
  • keep the current 5-second behavior as the default and validate the value the same way the idle service reads its timeouts
  • document the default in the shipped shell.json

Opening 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.sh
  • bash test/shell.d/lock-blank-fingerprint-test.sh
  • git diff --check

Copilot AI balanced review requested due to automatic review settings August 18, 2026 13:19

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

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.lockBlank from shell.shellConfig in the lock screen QML and use it to drive the blank timer interval.
  • Add idle.lockBlank: 5 to the shipped config/omarchy/shell.json defaults.
  • 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.

Comment thread test/shell.d/lock-blank-timeout-test.sh Outdated
)

assert(
/interval: root\.blankTimeoutSeconds \* 1000/.test(serviceQml),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment thread shell/plugins/lock/Service.qml Outdated
Comment on lines +20 to +24
// 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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Kept the inline conversion: the idle service's timers use the same seconds * 1000 form, and the property comment above documents the unit.

Copilot AI review requested due to automatic review settings August 18, 2026 13:22

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

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) into 0, which will make the timer interval 0 and likely blank immediately. Consider rounding instead (e.g., Math.round) and/or clamping to a sensible minimum, or compute milliseconds directly (e.g., keep a blankTimeoutMs real/int and set interval from 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

  • path is used but not required in this snippet. If the harness doesn’t reliably provide a global path, this test will fail; even if it does, explicitly adding const 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'))

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants