Skip to content

Add scope flags to omarchy-display-text-size - #6362

Open
jzetterman wants to merge 1 commit into
basecamp:quattrofrom
jzetterman:text-size-scope-flags
Open

Add scope flags to omarchy-display-text-size#6362
jzetterman wants to merge 1 commit into
basecamp:quattrofrom
jzetterman:text-size-scope-flags

Conversation

@jzetterman

Copy link
Copy Markdown
Contributor

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-tuned font-size in the Ghostty config.

This adds composable scope flags to omarchy-display-text-size:

omarchy display text size --shell 14        # shell only
omarchy display text size --gtk reset       # GTK scaling only
omarchy display text size --shell --terminals 16

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)
  • fullwidth digits (16) — locale-collated regex ranges match them → accepted (writes text-scaling-factor 0)
  • 64-bit wraparound (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 the default alias, flag/action ordering, help precedence, and validation (including one guard per bypass fix above). Everything runs in a sandboxed $HOME/$XDG_RUNTIME_DIR with stubbed gsettings/pkill/pgrep/omarchy-notification-send, following the existing suite's conventions.

🤖 Generated with Claude Code

--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>
Copilot AI review requested due to automatic review settings July 24, 2026 03:06

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 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-size with 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.sh with 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.

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