https://github.com/gxanshu/chrome-accent-sync
Sync your Linux desktop accent color to Chrome/Chromium automatically
https://github.com/gxanshu/chrome-accent-sync
chrome chromium gnome kde linux theming
Last synced: 3 months ago
JSON representation
Sync your Linux desktop accent color to Chrome/Chromium automatically
- Host: GitHub
- URL: https://github.com/gxanshu/chrome-accent-sync
- Owner: gxanshu
- Created: 2026-03-18T03:15:49.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-03-21T17:07:18.000Z (3 months ago)
- Last Synced: 2026-03-22T03:20:53.294Z (3 months ago)
- Topics: chrome, chromium, gnome, kde, linux, theming
- Language: Rust
- Homepage:
- Size: 9.12 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# chrome-accent-sync
Automatically sync your Linux desktop accent color to Chrome and Chromium browser theme. When you change your system accent color in GNOME, KDE Plasma, or any desktop that supports XDG Desktop Portal — your browser theme updates to match, instantly.
No browser extensions. No manual tweaking. Just your desktop color, everywhere.
https://github.com/user-attachments/assets/ff185416-19b2-494b-945b-cf389cbce969
## Why
Linux desktops like GNOME 47+ and KDE Plasma 6 let you pick a system-wide accent color. But Chrome and Chromium ignore it completely — your browser stays the same bland default while the rest of your desktop looks cohesive. This tool fixes that.
It listens for accent color changes over D-Bus and writes a [BrowserThemeColor](https://chromeenterprise.google/policies/#BrowserThemeColor) managed policy that Chrome picks up on its own — no restart needed.
```
System accent changes → D-Bus signal → chrome-accent-sync → writes policy JSON → Chrome picks it up
```
## Install
### Quick install
```bash
curl -fsSL https://raw.githubusercontent.com/gxanshu/chrome-accent-sync/main/install.sh | bash
```
Downloads the latest binary to `~/.local/bin/`. Works on x86_64 and aarch64.
### Build from source
```bash
git clone https://github.com/gxanshu/chrome-accent-sync.git
cd chrome-accent-sync
cargo build --release
cp target/release/chrome-accent-sync ~/.local/bin/
```
## Setup
Chrome needs a directory where it reads policy files. This is the only step that needs sudo, and you only do it once:
```bash
sudo mkdir -p /etc/chromium/policies/managed
sudo chown $USER /etc/chromium/policies/managed
```
## Usage
```bash
# Start the service
chrome-accent-sync install
# Check if it's running
chrome-accent-sync status
# Stop and remove everything
chrome-accent-sync uninstall
```
That's it. The service starts on login and keeps your browser in sync with your desktop. No sudo needed after the initial setup.
## Update
Run the install script again. If the service is already running, it restarts automatically with the new version.
```bash
curl -fsSL https://raw.githubusercontent.com/gxanshu/chrome-accent-sync/main/install.sh | bash
```
## Tip for GNOME users
If you're on GNOME and want the accent color to change automatically when you switch wallpapers, grab the [Auto Accent Colour](https://extensions.gnome.org/extension/7624/auto-accent-colour/) extension. It picks a matching accent color from your wallpaper, and chrome-accent-sync will carry that change straight into your browser. Wallpaper changes → accent changes → browser theme changes, all automatic.
## Supported desktops and browsers
### Desktop environments
- GNOME 47+
- KDE Plasma 6
- Any desktop that implements `org.freedesktop.appearance.accent-color` via XDG Desktop Portal
### Browsers
- Chromium
- Google Chrome
- Brave, Edge, and other Chromium-based browsers (using the same policy path)
### Distros
Works on any Linux distro with systemd — Fedora, Ubuntu, Arch, Debian, openSUSE, and others.
## How it works under the hood
Your desktop environment exposes the accent color over D-Bus through the [XDG Desktop Portal](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Settings.html). This tool connects to that portal, watches for changes to `org.freedesktop.appearance.accent-color`, converts the RGB values to hex, and writes a JSON file to `/etc/chromium/policies/managed/accent-color.json`:
```json
{
"BrowserThemeColor": "#3584E4"
}
```
Chrome reads this directory for managed policies and applies the theme color automatically. The service runs as a user-level systemd daemon — lightweight, no root, starts on login.
## License
MIT