Hyprland wallpaper changes → browser theme. Huepr listens for wallpaper events via Native Messaging and injects CSS custom properties into whitelisted sites in real time.
Built for Zen Browser and Firefox on Hyprland + Caelestia.
caelestia-wallhook → huepr-notify → huepr.pipe → theme_host.py → Native Messaging → background.js → content.js → CSS vars on :root
- Your wallpaper hook calls
huepr-notifywith the new wallpaper path. theme_host.pyextracts the wallpaper filename stem (e.g./path/to/Aurora.jpg→Aurora) and sends it to the extension via Native Messaging. The extension matches this name against your theme names.- The extension injects CSS custom properties into every whitelisted site.
- Sites that map their own CSS variables to theme variables update instantly.
- Wallpaper-driven theming — theme switches automatically when your wallpaper changes
- Per-site CSS variable mapping — map site variables (e.g.
--background) to theme variables (e.g.--theme-bg) - Per-site theme override — pin a specific theme to a site regardless of wallpaper
- Custom CSS injection — inject arbitrary CSS rules per theme (override hardcoded colors, SVG fills, etc.)
- Auto-detect site variables — scan the active tab's stylesheets and pick variables to map
- Color extraction from image — extract a palette from any image to seed a new theme
- Hook toggle — disable wallpaper trigger and pick a theme manually
- Smooth transitions — CSS transition injected on theme change, removed after 600ms
- Popup — quick access to hook toggle, manual theme select, and "Add current site"
- Auto-update —
huepr-updatere-fetches and re-installs from your git remote; optional systemd weekly timer
git clone https://github.com/Contraill/huepr
cd huepr
bash install.shRestart your browser. The extension loads automatically.
After installation the git directory can be deleted — extension files are copied to
~/.local/share/huepr/.
- Firefox or Zen Browser
- Python 3.8+
- git (used by
huepr-updateto fetch updates) - Caelestia with
caelestia-wallhook(for automatic wallpaper trigger)
huepr-updateOr let the systemd weekly timer handle it automatically (installed by default if systemd user instance is available).
Open the popup (click the Huepr icon) → Add current site, or go to Options → Sites & Mappings and type a hostname.
Options → Themes → type a name → Add Theme. The theme name must match (part of) your wallpaper filename for automatic switching.
Add variables to the theme — e.g. --theme-bg: #1e1e2e, --theme-accent: #cba6f7.
In Sites & Mappings, select a site. Add a mapping:
- Site variable — the CSS variable the site uses (e.g.
--background-color) - Theme variable — the theme variable to pull the value from (e.g.
--theme-bg)
Use Detect to scan the active tab's stylesheets and find variables automatically.
In Themes, select a theme and add custom CSS to override hardcoded colors:
/* Override YouTube logo red */
path[fill="#FF0033"] { fill: var(--theme-accent) !important; }install.sh — installer: copies files, sets up NM host, patches wallhook
manifest.json — WebExtension manifest (MV2)
background.js — background page: NM connection, theme resolution, message routing
content.js — content script: CSS variable + custom CSS injection
popup/ — browser action popup
options/ — options page (themes, sites & mappings, help)
host/
theme_host.py — native messaging host: reads pipe, sends theme to extension
icons/ — extension icons
A theme is a flat key-value map of CSS custom properties:
{
"--theme-bg": "#1e1e2e",
"--theme-surface": "#313244",
"--theme-accent": "#cba6f7",
"--theme-fg": "#cdd6f4",
"--theme-border": "#45475a"
}When active, all theme variables are injected into :root on whitelisted sites. Site mappings then alias site-specific variables to theme values:
--site-background → value of --theme-bg
--site-link-color → value of --theme-accent
Extension icon doesn't appear
Check about:debugging → This Firefox → Extensions to verify Huepr is loaded. In about:config, confirm xpinstall.signatures.required is false.
Theme doesn't switch on wallpaper change
- Verify
caelestia-wallhookis patched:grep huepr-notify ~/.local/bin/caelestia-wallhook - Verify the native host is running:
about:debugging→ Huepr → Inspect → check the background console for connection messages
CSS variables not applying Open Options → Sites & Mappings → confirm the site is whitelisted and has mappings. Use the Detect button to find available CSS variables on the active tab.
huepr-update fails
Check that ~/.config/huepr/config contains a valid REPO_URL pointing to a git remote.
MIT