Repository navigation
Add user theme support - #79
Conversation
Resolve theme from ~/.config/bcq/theme/colors.toml, falling back to the default Material Design theme. Supports: - NO_COLOR env var (industry standard for disabling colors) - BCQ_THEME env var for custom theme file path - User theme directory can be symlinked to system themes Color mapping from terminal color formats: - accent/color4 → Primary - color1 → Error, color2 → Success, color3 → Warning - color7 → Secondary, color8 → Muted/Border - foreground/background → Foreground/Background
If ~/.config/omarchy/current/theme exists, symlink it to ~/.config/bcq/theme so bcq automatically uses the system theme.
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive user theme support to bcq, enabling users to customize colors through configuration files, environment variables, or symlinks to system themes like Omarchy.
Changes:
- Added
ResolveTheme()function with precedence: NO_COLOR → BCQ_THEME env → user config (~/.config/bcq/theme/colors.toml) → default - Implemented lightweight TOML parser for theme files with validation
- Updated installer to auto-detect and symlink Omarchy theme during installation
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| internal/tui/theme.go | Core theme resolution logic with TOML parsing, color validation, and mapping to bcq semantic colors |
| internal/tui/theme_test.go | Comprehensive test coverage for theme parsing, validation, and resolution logic |
| internal/output/render.go | Integration of ResolveTheme() into NewRenderer() to apply user themes to CLI output |
| scripts/install.sh | Added setup_theme() function to auto-detect and symlink Omarchy theme during installation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a614dbe539
ℹ️ 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".
- Strip inline TOML comments before parsing (e.g., `accent = "#89b4fa" # blue`) - Add test cases for inline comments and unquoted values - Improve test isolation in ResolveTheme tests - Add dedicated LoadUserTheme test coverage - Clarify render.go comment to not reference Omarchy specifically - Add error handling for symlink creation in installer
* Add user theme support with colors.toml Resolve theme from ~/.config/bcq/theme/colors.toml, falling back to the default Material Design theme. Supports: - NO_COLOR env var (industry standard for disabling colors) - BCQ_THEME env var for custom theme file path - User theme directory can be symlinked to system themes Color mapping from terminal color formats: - accent/color4 → Primary - color1 → Error, color2 → Success, color3 → Warning - color7 → Secondary, color8 → Muted/Border - foreground/background → Foreground/Background * Auto-link Omarchy theme in installer If ~/.config/omarchy/current/theme exists, symlink it to ~/.config/bcq/theme so bcq automatically uses the system theme. * Address PR review feedback - Strip inline TOML comments before parsing (e.g., `accent = "#89b4fa" # blue`) - Add test cases for inline comments and unquoted values - Improve test isolation in ResolveTheme tests - Add dedicated LoadUserTheme test coverage - Clarify render.go comment to not reference Omarchy specifically - Add error handling for symlink creation in installer
Summary
~/.config/bcq/theme/colors.tomlNO_COLORenv var (industry standard for disabling colors)BCQ_THEMEenv var for custom theme file pathHow it works
bcq looks for its own theme config at
~/.config/bcq/theme/colors.toml. On systems like Omarchy, users symlink to their system theme:The installer automatically creates this symlink if Omarchy is detected.
Color mapping
accent/color4color1color2color3color7color8foregroundbackgroundTest plan
make checkpassesNO_COLOR=1 bcq projectsdisables colorsBCQ_THEME=/path/to/colors.tomluses custom theme