Add scope flags to omarchy-display-text-size - #6362
Conversation
--shell, --gtk, and --terminals let each of the three linked surfaces be set or reset individually; with no flags the one-knob behavior is unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds scope flags to omarchy-display-text-size so users can adjust shell/GTK/terminal text sizing independently while preserving the existing unflagged “all surfaces together” behavior, and introduces a dedicated shell test suite covering the new CLI parsing/validation paths.
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.
Changes:
- Extend
omarchy-display-text-sizewith composable scope flags (--shell,--gtk,--terminals) plus stricter argv validation. - Harden size validation to block previously-admitted invalid inputs (leading-zero/octal quirks, non-ASCII digits, wraparound-sized integers).
- Add
test/shell.d/display-text-size-test.shwith sandboxed config mutation and side-effect assertions across scoped/unscoped actions.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| bin/omarchy-display-text-size | Adds scope flags, strict argv parsing, and updated size validation for the display text-size knob. |
| test/shell.d/display-text-size-test.sh | Adds sandboxed shell tests covering status/set/reset, scoped isolation, help precedence, and validation edge cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Superseded by #6550 — same scope flags, plus the Display panel disclosure UI that uses them, rebased onto current |
Follow-up to my comment on #6231: the unified text-size knob is a great one-touch default, but it hard-links three surfaces (shell font, GTK
text-scaling-factor, terminal font size) that don't always want to move together, and there's no way to express "just the shell." Concrete case: a 4K display at scale 1 where bumping the shell also inflated every Chromium/Electron app and silently rewrote a hand-tunedfont-sizein the Ghostty config.This adds composable scope flags to
omarchy-display-text-size:With no flags, behavior is exactly today's — all three surfaces together, same values, same reload signals. The display-settings slider and the XPS 13 hardware script call the CLI unflagged and are untouched; passing all three flags is identical to passing none. Status output is unchanged.
While making argv strict (flags require exactly one action; unknown tokens error instead of being silently ignored), the validation also picks up fixes for three latent bypasses in the current size check, where bash quirks let invalid tokens through the range guard and into the configs:
08/09— octal arithmetic error → accepted (writes an out-of-range size)16) — locale-collated regex ranges match them → accepted (writestext-scaling-factor 0)18446744073709551625→ 9) → accepted (writes the huge literal)All three now get the standard size error with nothing written.
Tests:
test/shell.d/display-text-size-test.sh— 11 cases covering the unflagged regression paths (status/set/reset, reload signals), per-flag isolation (unscoped surfaces byte-identical, no signals or notifications), scoped reset including thedefaultalias, flag/action ordering, help precedence, and validation (including one guard per bypass fix above). Everything runs in a sandboxed$HOME/$XDG_RUNTIME_DIRwith stubbedgsettings/pkill/pgrep/omarchy-notification-send, following the existing suite's conventions.🤖 Generated with Claude Code