Skip to content

Map Omarchy light/dark to Grok built-in themes - #6521

Closed
scottjones wants to merge 8 commits into
omacom:quattrofrom
scottjones:feat/grok-theme-sync
Closed

scottjones wants to merge 8 commits into
omacom:quattrofrom
scottjones:feat/grok-theme-sync

Conversation

@scottjones

@scottjones scottjones commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Grok's live external retint path is theme = "auto" plus OS light/dark. This maps Omarchy onto Grok's built-ins through that path, without fighting a manual theme choice forever.

  • New omarchy-theme-set-grok (hidden), wired into omarchy-theme-set and install/user/theme.sh
  • --activate once (install does this): set theme=auto, seed auto_dark_theme / auto_light_theme, leave a follow flag
  • While following: each Omarchy theme switch refreshes the auto_* maps (and keeps theme=auto)
  • If the user picks a fixed Grok theme: stop following and leave config alone until they run --activate again
  • No-op when Grok is not installed ($GROK_HOME missing), including on --activate so finalize never aborts under set -e

After one Grok restart into auto mode, Omarchy light↔dark switches retint live. Same-polarity maps (e.g. tokyo-night → tokyonight) update for the next start.

Test plan

  • ./test/cli (no-op before activate, activate without home, activate, preserve marketplace AOT + keys, tokyo-night/nord maps, stop on manual theme with comment, re-activate)
  • ./test/shell (user-theme-test mocks grok activate)
  • Fresh: activate + restart Grok, light↔dark Omarchy themes retint live
  • In Grok, /theme oscura-midnight, change Omarchy theme → Grok config stays oscura, follow stops
  • omarchy-theme-set-grok --activate resumes follow
  • Without ~/.grok, theme.sh --activate does not fail finalize

Stock Grok has no custom theme files, so follow mode sets theme=auto
with closest-match auto_dark_theme / auto_light_theme and opt-in
activate, matching the Pi/Claude theme-set shape.
Match omarchy-theme-set-gnome: call omarchy-theme-color directly.
Document that live external retint is theme=auto + OS appearance.
Drop the opt-in follow flag; mirror Pi by writing whenever ~/.grok
exists, and call activate from install/user/theme.sh.
Activate once (install or --activate), update mappings while [ui].theme
is auto/system, and stop if the user picks a fixed Grok theme.
Mock omarchy-theme-set-grok in user-theme-test and only print the
restart guidance when stdout is a TTY.
--activate no-ops (exit 0) if ~/.grok is missing so theme.sh under set -e
still links the btop theme. Drop unused mode lookup that could fail hard.
Use tomllib for [ui].theme, expand closest-match dark mappings, and
preserve marketplace array-of-tables in the CLI fixture.
@scottjones
scottjones marked this pull request as ready for review August 2, 2026 22:49
Copilot AI review requested due to automatic review settings August 2, 2026 22:49

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 opt-in Grok theme synchronization, mapping Omarchy themes to Grok’s automatic light/dark themes while respecting manual choices.

Changes:

  • Adds Grok activation and follow-state handling.
  • Integrates synchronization into installation and theme switching.
  • Adds CLI and installer test coverage.

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 3 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
bin/omarchy-theme-set-grok Implements Grok theme synchronization.
bin/omarchy-theme-set Runs Grok synchronization after theme changes.
install/user/theme.sh Activates Grok following during setup.
test/cli Tests synchronization and opt-out behavior.
test/shell.d/user-theme-test.sh Mocks the installer integration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

chmod +x "$mock_bin/omarchy-theme-set"

for command in omarchy-theme-set-pi; do
for command in omarchy-theme-set-pi omarchy-theme-set-grok; do

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch — updated the mocks to record command + args and assert both omarchy-theme-set-pi --activate and omarchy-theme-set-grok --activate on seed and re-run finalize.

Record mock argv for theme-set-pi/grok so the installer test fails if
--activate is omitted.
Copilot AI review requested due to automatic review settings August 2, 2026 22:53

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

Copilot reviewed 3 out of 5 changed files in this pull request and generated no new comments.

@omarchybot omarchybot added the enhancement New feature or request label Sep 27, 2026
@dhh

dhh commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Thanks! Closing this as part of wrapping up the Grok work in #13992 and #14004.

@dhh dhh closed this Oct 2, 2026
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.

4 participants