Skip to content

Add declarative Hyprland and terminal theming - #8720

Open
OldJobobo wants to merge 14 commits into
omacom:quattrofrom
OldJobobo:feat/declarative-hyprland-terminal-theme
Open

OldJobobo wants to merge 14 commits into
omacom:quattrofrom
OldJobobo:feat/declarative-hyprland-terminal-theme

Conversation

@OldJobobo

@OldJobobo OldJobobo commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Add declarative Hyprland and terminal theming

What is the value?

The security change in #7884 correctly stopped installed themes from supplying executable Lua and complete terminal configs. It also removed much of each theme's intended presentation.

This restores those appearance settings as data. Omarchy validates the data and generates the trusted configuration itself. Theme authors no longer need Lua for normal Hyprland styling or separate configs for terminal opacity and blur. Users still install and select themes exactly as they do today.

Related to #7942, includes the narrower Hyprland scope proposed in #8210, and complements the refusal notifications in #8393.

What changes

Themes can add three optional terminal settings to colors.toml:

terminal_opacity = 0.82
terminal_blur = true
terminal_blur_radius = 28

Omarchy maps them through its existing Alacritty, Foot, Ghostty, and Kitty templates. Themes do not control the rest of the terminal config.

Themes that need more than colors can add an optional hyprland.toml:

schema = 1

[general]
gaps_in = 8
gaps_out = 16
border_size = 3

[decoration]
rounding = 16
inactive_opacity = 0.94

[decoration.blur]
enabled = true
size = 8
passes = 3

[decoration.shadow]
enabled = true
range = 22
color = "#000000aa"
offset = "0 4"

The schema covers gaps, borders, rounding, opacity, dimming, blur, shadows, groupbars, bezier curves, and Hyprland's known animation leaves. Colors can be literals or references to keys in colors.toml.

omarchy-theme-set-templates validates these values and adds them to the hyprland.lua Omarchy already generates. With no hyprland.toml, generation behaves exactly as before. A trusted local theme's hand-written hyprland.lua still takes precedence.

Screenshots

Earlier testbed snapshot

This earlier Git-style test theme was applied in the Omarchy Testbed VM with terminal opacity 0.82, blur radius 28, window rounding 16, wider gaps, a three-pixel border, and a themed shadow:

Declarative Hyprland and Foot settings in the earlier Omarchy Testbed run:
https://github.com/user-attachments/assets/0dab5cde-3f7d-401f-aebb-c82496b1c26c

Animation-validator captures — 222507c

Unedited 1280×800 full-desktop screenshots from a disposable VM running real Hyprland and Foot. These are not mockups or cropped panel images. The candidate source matches the animation-validation fix in 222507c6; the later i18n commit leaves that validator unchanged.

Before — a427cea: the animation declaration is rejected, so the declared Hyprland appearance is not applied.

Before: real Foot window with the rejected Hyprland declaration and default appearance

After — 222507c: the declaration is accepted, with the specified rounding, gaps, blur and three-pixel border.

After: real Foot window with the validated declaration, rounding, wider gaps, blur and three-pixel border

Each capture uses a newly opened window. These still images do not demonstrate rotation, smoothness, or restarting a stopped loop on an already-open window. The separate native lossless recordings remain local.

Security boundary

hyprland.toml is a strict, allowlisted TOML schema. Omarchy checks its types, numeric ranges, colors, curves, animation names, and styles before serializing anything to Lua. Invalid declarations warn and fall back to the normal generated Hyprland appearance.

Installed themes still cannot provide Lua, complete terminal configs, commands, binds, monitor or input settings, rules, plugins, includes, environment values, or arbitrary paths. Theme installation, trust classification and executable-file filtering remain unchanged. Staging distinguishes bundled Lua from trusted local Lua so validated declarations can extend bundled appearance settings.

Current verification — db57614

The i18n watcher correction passed the expanded startup regression and a 200-cycle write/delete diagnostic. The feature-branch VM run passed CLI and all 421 shell test files, with checks skipped in seven files.

Hosted CI tested the merge with upstream 54abf723. The i18n regression passed, but network-panel-runtime-test.sh failed: its fixture calls activateRequested() without the modifier argument now required by upstream. Greptile, translation structure and visual-evidence checks passed. The overall hosted test suite is still red.

Hosted test run:
https://github.com/omacom/omarchy/actions/runs/42850660627

Earlier verification — 222507c

  • Animation validation now matches the leaf: angular loop/once, compatible window/workspace/layer styles, and no styles on leaves that do not support them. Enabled animations require a positive speed and a curve.
  • Both new regressions fail before their respective fixes and pass after them. Coverage remains in the existing theme-staging fixture.
  • Focused staging, templates, window transparency, install guards and color-reference checks pass, including real Foot and Ghostty config validation. Bash syntax, changed-command ShellCheck and whitespace checks pass; sourced-fixture lint supplies its Bash/caller context.
  • Disposable-VM checks load the generated Lua in real Hyprland and show the rotating border on a newly mapped Foot window, alongside the declared rounding and blur. This is not evidence that an already-open window restarts a stopped angle loop, or a VM performance certification.
  • The fresh full-desktop screenshots above are now attached. Native lossless recordings remain local; still images do not demonstrate rotation. The earlier testbed snapshot remains historical.
  • The final local full suite is not all green: CLI completed; 420 of 421 shell files completed without failures, with skipped checks in seven files. update-lock-test.sh failed with a child-process wait error; one isolated run on unchanged current upstream passed. Its cause is unestablished. Earlier failed logs, including i18n catalog watching and three companion-checkout setup failures, are preserved. No unrelated update/i18n changes or timeout increases were made.

Hosted Tests failed on this exact head in i18n-startup-test.sh: deleting the language-selection file left Danish active instead of restoring English. Theme-staging checks passed, with Ghostty validation skipped because CI lacks Ghostty. The cause of the i18n failure is not established; the suite has not been rerun to seek a green result. The translation-structure check passed, and Greptile reported no new actionable findings.

Hosted test run:
https://github.com/omacom/omarchy/actions/runs/42770302735

The terminal-opacity scope overlaps #8407; choosing or splitting that work remains a maintainer decision.

--[ Pi :: gpt-6-astra ]--
--- on behalf of: @OldJobobo

@OldJobobo
OldJobobo marked this pull request as ready for review August 28, 2026 05:16
Copilot AI balanced review requested due to automatic review settings August 28, 2026 05:16

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 validated, declarative terminal and Hyprland appearance settings while preserving the installed-theme security boundary.

Changes:

  • Adds terminal opacity and blur template values.
  • Validates hyprland.toml and generates trusted Lua overrides.
  • Adds documentation and shell tests.

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.

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
bin/omarchy-theme-color Resolves terminal appearance settings.
bin/omarchy-theme-set-templates Validates and renders declarative settings.
default/themed/alacritty.toml.tpl Adds opacity and blur.
default/themed/foot.ini.tpl Adds alpha and blur.
default/themed/ghostty.conf.tpl Adds opacity and blur.
default/themed/kitty.conf.tpl Adds opacity and blur.
docs/theming.md Documents the new schema.
test/shell.d/theme-declarative-settings-test.sh Tests validation and rendering.
test/shell.d/theme-staging-test.sh Tests safe staging of Hyprland data.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@OldJobobo
OldJobobo marked this pull request as draft August 28, 2026 05:24
@OldJobobo
OldJobobo marked this pull request as ready for review August 28, 2026 05:24

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 13593b5f87

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bin/omarchy-theme-set-templates Resolved
@OldJobobo
OldJobobo marked this pull request as draft August 30, 2026 15:40
@OldJobobo
OldJobobo marked this pull request as ready for review August 30, 2026 15:41
@OldJobobo
OldJobobo marked this pull request as draft August 31, 2026 04:19
@OldJobobo
OldJobobo marked this pull request as ready for review August 31, 2026 15:20
@scttymn

scttymn commented Aug 31, 2026 •

Copy link
Copy Markdown

This is the exact hole we hit with a git-installed extra theme.

Cpunk (fork to add Quattro support, btw) depends on more than palette: a 3px 8-stop black/steel stripe and a borderangle loop. hyprland_active_border in colors.toml survives omarchy theme install, so the gradient colors still apply. Everything else lives in hyprland.lua (border_size = 3, gaps_in/gaps_out = 3, hl.animation({ leaf = "borderangle", enabled = true, speed = 100, bezier = "linear", style = "loop" })), which staging strips.

Result after a successful install: Omarchy's default 2px static border. The stripe is technically there and basically invisible, and it does not spin. No warning that the chrome was dropped.

A local/symlink copy of the same tree applies the Lua and looks right. That's the documented workaround, not a path extra themes can use.

hyprland.toml as specified here would let Cpunk declare that chrome as data:

schema = 1

[general]
gaps_in = 3
gaps_out = 3
border_size = 3

[[animations]]
name = "borderangle"
enabled = true
speed = 100
curve = "linear"
style = "loop"

That matches the security boundary in #7884 (no Lua, binds, or rules from a clone) and is the difference between "installed" and "looks like the theme". Happy to test a build against Cpunk if useful.

@greptile-apps

greptile-apps Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] No new actionable issue was established in the changes since the previous review.

Summary

Adds declarative terminal and Hyprland appearance settings while keeping installed themes from supplying executable configuration.

  • Themes can set Hyprland’s gaps, decoration, and animations with checked data.
  • Themes can set opacity and blur across Alacritty, Foot, Ghostty, and Kitty.
  • Translation readers keep updating when their files change or move.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Theme data] --> B[Validate settings]
  B --> C[Generate trusted configs]
  C --> D[Apply desktop appearance]
  E[Translation file changes] --> F[Independent watches]
  F --> G[Reload translation text]
  G --> H[Update shell and plugin strings]
Loading

Reviews (10) · Last reviewed commit: "Keep translation watches alive across fi..." · Reviewed by Greptile

Comment thread bin/omarchy-theme-color Resolved
Comment thread bin/omarchy-theme-set-templates Resolved
Ghostty loads a config-file after the file that names it, so the theme's ghostty.conf overrides ~/.config/ghostty/config. Emitting background-opacity = 1.0 and background-blur = false for every theme silently replaced a user's own Ghostty opacity and blur on each theme switch. The generated Ghostty config now carries only the settings a theme declares (validly), and a comment otherwise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 9b4e330 and pushed one fix; the branch is now at 90f164b.

Ghostty: a user's own opacity and blur were overridden on every theme. Ghostty loads a config-file only after the file that names it, so the theme's ghostty.conf wins over ~/.config/ghostty/config. With background-opacity = {{ terminal_opacity }} and background-blur = ... always emitted, every theme without the new keys wrote background-opacity = 1.0 and background-blur = false, silently replacing a user's own Ghostty transparency on each theme switch. Checked with Ghostty itself on a worker: a user config setting background-opacity = 0.6 and background-blur = 10 came out as 1 and false once the theme file carried the defaults, and kept 0.6/10 without them. Alacritty, Foot and Kitty read their theme include first, so the user's settings still win there and nothing changes for them.

90f164b makes the generated Ghostty config carry only the settings a theme declares validly (terminal_opacity_ghostty / terminal_blur_ghostty render either the setting or a comment line), notes it in docs/theming.md, and adds tests for both the undeclared case and a theme that declares the defaults explicitly. Reverting the fix makes the new test fail.

Greptile's two findings at 575d56b were already fixed by 9b4e330, and both are proved: on a worker, restoring the 575d56b bin/omarchy-theme-color fails "commented opacity resolves", and restoring the 575d56b bin/omarchy-theme-set-templates fails "Hyprland resolves legacy background aliases". The older Codex connector finding (declarations dropped over bundled hyprland.lua) was fixed in 529da39 and is covered by the Kanagawa cases in theme-staging-test.sh.

Also checked by reading: the hyprland.toml validator only emits ASCII names, allowlisted keys, regex-checked colours and bounded numbers, so nothing from a cloned theme reaches the Lua as anything but data; an installed theme still cannot ship hyprland.lua (*.lua is denied at staging); and omarchy-theme-set is the only caller of omarchy-theme-set-templates, so the new OMARCHY_THEME_HYPRLAND_LUA_FROM_STOCK handoff has no other caller to miss it.

Tests, on a disposable Omarchy worker at 90f164b: ./test/cli green, and every theme, colour and terminal test under test/shell.d/ (15 files, including theme-declarative-settings-test.sh and theme-staging-test.sh) green. Generated Foot config passes foot --check-config, and the generated Ghostty config passes ghostty +validate-config. Alacritty and Kitty output was not run in those terminals.

Scope: this carries two features, terminal opacity/blur in colors.toml and the hyprland.toml schema, and the first overlaps #8407, which adds the narrower terminal_opacity token alone and emits the same always-on Ghostty background-opacity line fixed here. Splitting the terminal half off, or landing one of the two, is the maintainer's call.

No second opinion ran: the configured reviewer, Codex Medium, answers omabot review --ping, but today's review budget was spent, so this review is one model's (Claude Opus 5.5). Waiting on the maintainer.

Comment thread bin/omarchy-theme-color Resolved
Comment thread bin/omarchy-theme-color Resolved
@OldJobobo

Copy link
Copy Markdown
Contributor Author

Updated against current quattro, preserving its window-level Glassy fade instead of restoring a second terminal opacity layer. Theme-declared opacity remains intact.

Addressed the review: explicit Ghostty theme blur now installs its GTK stylesheet even with Glassy off, without changing other GTK apps. The regression checks both the stylesheet and isolation. Declarative schema/rendering coverage now runs through the existing theme-staging suite with a sourced fixture. Consolidated staging, template, transparency and CLI tests pass locally; full VM CI is running on the current head.

--[ Pi :: gpt-6.1-sol ]--
--- on behalf of: @OldJobobo

@OldJobobo

Copy link
Copy Markdown
Contributor Author

Current-head CI finished with all 421 files completing and one failure: i18n-startup-test.sh. The same file fails on unchanged upstream quattro at b99593e in its own run 42585717220, while the focused staging/renderer tests and current Greptile review pass. I have not changed unrelated i18n code or rerun the suite merely to seek a green result.

Upstream baseline run:
https://github.com/omacom/omarchy/actions/runs/42585717220

Current-head run:
https://github.com/omacom/omarchy/actions/runs/42654809009

--[ Pi :: gpt-6.1-sol ]--
--- on behalf of: @OldJobobo

@OldJobobo

Copy link
Copy Markdown
Contributor Author

Pushed 222507c with a further validation fix. The borderangle loop requested in the discussion was rejected, while combinations Hyprland rejects (for example windows with fade) passed the shared style allowlist. Styles are now checked per animation leaf. Enabled animations also require a positive speed and a curve; malformed animation names are rejected without a traceback. Expanded the existing staging fixture and documented the rules.

Both new regressions fail before their respective fixes and pass after them. The focused theme/staging/transparency checks and real Foot/Ghostty configuration validation pass. In a disposable VM, the generated candidate Lua loads successfully and a newly opened Foot window shows the declared rounding, border and rotating gradient. The original renderer rejects the loop declaration; its generated windows/fade declaration produces Hyprland's unknown style error. Native full-desktop recordings and lossless screenshots are kept locally; upload is pending browser authentication. This does not claim that a stopped loop restarts on an already-open window, nor certify VM animation performance.

The final local aggregate is not all green: CLI completed, 420 of 421 shell files completed without failures, seven files contained skips, and update-lock-test.sh failed with wait: pid … is not a child of this shell. That unchanged test passed once on current upstream; the cause is not established. The earlier local run is also preserved: it had three setup failures from my obsolete companion-package checkout plus an i18n catalog-deletion failure. The corrected final run passed i18n, but that does not establish the intermittent catalog problem as fixed. No unrelated update/i18n code or test timeouts were changed.

Fresh hosted checks for this exact commit are running. Maintainer commits and existing fixes remain intact. The scope overlap with #8407 remains a maintainer decision; I have not changed or closed that PR.

--[ Pi :: gpt-6-astra ]--
--- on behalf of: @OldJobobo

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants