Skip to content

Look for a glass block before building its sed addresses - #15191

Merged
dhh merged 1 commit into
quattrofrom
theme-glass-skip-regex
Oct 13, 2026
Merged

dhh merged 1 commit into
quattrofrom
theme-glass-skip-regex

Conversation

@dhh

@dhh dhh commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

What changed

omarchy-theme-set-templates ends with omarchy-theme-set-glass "$NEXT_THEME_DIR", which sits on the critical path of every theme switch, before the shell sees the new palette. For each of five terminal/btop files, remove_block spawned two sed subshells to escape the marker strings, and only then grepped for a block. A freshly rendered theme file never holds a block, so that work was always thrown away.

The grep now runs first, and the seds only run when there is a block to remove.

Measurements

omarchy-theme-set-glass on a freshly rendered Tokyo Night staging dir, 10 runs: 110ms → 32ms, so ~11ms → ~3ms per theme switch. Template rendering as a whole drops from ~30–45ms to ~22–37ms.

Tests

The existing glass coverage in hyprland-window-transparency-test.sh (adding, replacing and removing blocks, newline restoration) passes unchanged, as do theme-templates and theme-staging. The behaviour is identical. This only reorders work, so no new test.

🤖 Generated with Claude Code

Every theme switch runs omarchy-theme-set-glass on freshly rendered files,
which never hold a block, yet each file first spawned two seds to escape
the markers. Checking for the block first takes the step from ~11ms to
~3ms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@greptile-apps

greptile-apps Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low impact] This PR appears safe to merge.

Summary

remove_block now checks for a glass block before building its sed addresses.

  • Theme switches check for a glass block before building its removal addresses.

Reviews (1) · Last reviewed commit: "Look for a glass block before building i..." · Reviewed by Greptile

@dhh
dhh merged commit b11ba67 into quattro Oct 13, 2026
1 check passed
@dhh
dhh deleted the theme-glass-skip-regex branch October 13, 2026 11:43
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
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