Skip to content

Follow the active theme in Hunk - #10917

Open
ryankv wants to merge 1 commit into
omacom:quattrofrom
ryankv:hunk-theme
Open

Follow the active theme in Hunk#10917
ryankv wants to merge 1 commit into
omacom:quattrofrom
ryankv:hunk-theme

Conversation

@ryankv

@ryankv ryankv commented Sep 9, 2026

Copy link
Copy Markdown

Omarchy installs Hunk as the diff viewer and opens it in every tmux dev square, but it kept GitHub's palette through every theme switch while btop, Helix, Claude Code and the rest retinted.

Hunk defines custom themes inline in config.toml and has no theme directory, so this follows the Claude Code and T3 Code shape with one twist: a generated hunk.json carries the palette, omarchy-theme-set-hunk publishes it to ~/.config/hunk/themes/omarchy.json on every theme change, and a small extension in ~/.config/hunk/extensions/ registers it under the id omarchy. Hunk loads user extensions without a trust prompt. The only line Omarchy writes into config.toml is theme = "omarchy", and only while Hunk is still on its default; a theme chosen in Hunk's config stays, and --activate replaces it by name.

The palette is validated before it is published, since Hunk rejects a theme whole on any value that is not #rrggbb: only Hunk's colour keys, a base id and hex syntax scopes pass, so an unresolved placeholder or a theme's own off-format hunk.json leaves the previous palette in place. The base flips with the theme's mode so light themes inherit GitHub's light defaults for anything unset.

Hunk reads its config at startup, so open sessions pick the palette up when relaunched (live reload is open upstream as modem-dev/hunk#486). A migration re-stages the current theme so existing installs follow along at the next update.

Tested by rendering the template for all 22 stock themes and launching Hunk against the dark and light results, which paint the rendered background, panel and diff-row colours exactly.

Omarchy installs Hunk as the diff viewer and opens it in every tmux dev
square, but it kept GitHub's palette through every theme switch while
btop, Helix, Claude Code and the rest retinted.

Hunk defines custom themes inline in config.toml and has no theme
directory, so writing a palette there would mean rewriting the user's
config on every switch. It does load extensions from
~/.config/hunk/extensions without a trust prompt, and an extension can
register a theme with the same table Hunk's config accepts. So a generated
hunk.json carries the palette the way claude.json and t3code.json do,
omarchy-theme-set-hunk publishes it to ~/.config/hunk/themes/omarchy.json
on every theme change, and a small extension registers it under the id
"omarchy". The only line Omarchy ever writes into config.toml is the theme
selection, and only while Hunk is on its default: a theme chosen in Hunk's
config stays, and --activate replaces it by name.

Hunk rejects a theme whole on any value that is not #rrggbb, and the file
is spread into a registration, so the palette is validated before it is
published: only Hunk's colour keys, a base id and hex syntax scopes pass,
and an unresolved placeholder or a theme's own off-format hunk.json leaves
the previous palette in place. The base flips with the theme's mode so
light themes inherit GitHub's light defaults for everything unset.

Hunk reads its config at startup, so open sessions pick the palette up
when relaunched. A migration re-stages the current theme so existing
installs follow along at the next update rather than the next switch.
Comment thread manual/06-themes.md
Omarchy comes with twenty-two beautiful themes. You can select between them via _Style > Theme_ in the Omarchy Menu (`Super + Space`) or hop directly to the theme selector using `Super + Ctrl + Shift + Space`.

Each theme styles the desktop, terminal, neovim, activity screen (btop), Chromium, and the entire Omarchy shell: top bar, menu, notifications, OSD, and the lock screen. (For Obsidian, you must manually select the Omarchy theme via _Appearance > Themes_ inside the app).
Each theme styles the desktop, terminal, neovim, activity screen (btop), diff viewer (Hunk), Chromium, and the entire Omarchy shell: top bar, menu, notifications, OSD, and the lock screen. (For Obsidian, you must manually select the Omarchy theme via _Appearance > Themes_ inside the app).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

it might be unnecessary to include this here

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.

1 participant