Skip to content

Add Calibre theme integration#4829

Open
chipkoziara wants to merge 2 commits intobasecamp:devfrom
chipkoziara:calibre-theme-integration
Open

Add Calibre theme integration#4829
chipkoziara wants to merge 2 commits intobasecamp:devfrom
chipkoziara:calibre-theme-integration

Conversation

@chipkoziara
Copy link
Copy Markdown

@chipkoziara chipkoziara commented Mar 1, 2026

Problem Statement

Calibre doesn't natively update with Omarchy themes, so I added a new script and call in bin/omarchy-theme-set to trigger Calibre theme changes. Calibre is a little finicky with updating themes, so I added logic to make sure it closes and applies the theme whenever a user changes the Omarchy theme.

Summary

Syncs the current Omarchy theme to Calibre's custom palette system when switching themes. Follows the same pattern as the existing Obsidian, VS Code, and browser integrations.

  • Parses colors.toml and maps colors to Qt QPalette roles (deriving shades like AlternateBase and PlaceholderText via a blend() helper since colors.toml only has ~6 base colors but Calibre's palette needs 15)
  • Detects light/dark mode via light.mode marker
  • Writes the palette to Calibre's gprefs via calibre-debug -c (Calibre stores palettes in a Python-managed JSON config, not a plain file)
  • Restarts Calibre if it was running -- kills it before writing the palette because Calibre's shutdown handler saves its in-memory config to disk, which would overwrite our changes
  • Reopens Calibre on its original workspace after restarting -- captures the workspace via hyprctl before killing, then sets a temporary windowrule so it opens silently in the right place
  • Guarded by omarchy-cmd-present calibre -- no-op if Calibre isn't installed

Files

  • bin/omarchy-theme-set-calibre → new script
  • bin/omarchy-theme-set → added omarchy-theme-set-calibre between obsidian and keyboard

Copilot AI review requested due to automatic review settings March 1, 2026 01:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


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

@chipkoziara chipkoziara force-pushed the calibre-theme-integration branch from 6503cc7 to dc0b8d4 Compare March 1, 2026 01:48
Copilot AI review requested due to automatic review settings March 1, 2026 01:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


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

@chipkoziara
Copy link
Copy Markdown
Author

Here's a demo of Calibre's theme updating with Omarchy theme changes:

calibre-theme-demo.mp4

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