Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions ungoogled-chromium/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Ungoogled Chromium

Themes the (ungoogled) Chromium browser chrome with the Noctalia palette.

Chromium has no `userChrome.css` equivalent, so this template uses Chromium's
native theming mechanism: a **theme extension** (a folder with a `manifest.json`
that declares colors and tints). Noctalia renders that manifest with the current
palette into a stable location; you load it into the browser **once**, and every
palette/theme change after that only rewrites the manifest in place.

## What it themes

Chromium theme colors apply to the window frame, tab strip / toolbar, the
bookmark bar text, and the new-tab page. The template maps the Noctalia M3
tokens onto those colors:

| Chromium key | Noctalia token |
| --- | --- |
| `frame` / `frame_inactive` | `background` / `surface_dim` |
| `toolbar` | `surface_container` |
| `tab_text` / `bookmark_text` | `on_surface` |
| `tab_background_text` | `on_surface_variant` |
| `ntp_background` | `surface_container_low` |
| `ntp_text` | `on_surface` |
| `ntp_link` | `primary` |
| `button_background` | `surface_container_high` |
| `control_background` | `surface_container` |

Because a static theme cannot follow `prefers-color-scheme`, the manifest uses
`default`-mode tokens (your current Noctalia mode). Switching dark/light in
Noctalia re-renders the manifest; restart the browser to apply.

## Setup

1. **Apply the template** in Noctalia (Settings → Templates, or `noctalia msg
templates-apply`). It writes:
`$XDG_CACHE_HOME/noctalia/ungoogled-chromium/theme/manifest.json`
2. **Load it once** in the browser:
- Open `chrome://extensions`
- Enable **Developer mode** (top-right)
- Click **Load unpacked** and choose
`$XDG_CACHE_HOME/noctalia/ungoogled-chromium/theme`
3. (Alternative) launch with `--load-extension=$XDG_CACHE_HOME/noctalia/ungoogled-chromium/theme`
— useful for wrapper scripts / portable setups.

The unpacked theme stays installed (Chromium remembers the path), and it points
at the folder Noctalia rewrites, so future palette changes just need a browser
restart.

## Apply changes

Restart the browser after a palette/theme update so the new colors are applied.

## Troubleshooting

- **Theme not appearing:** confirm the folder was loaded as an unpacked
extension (`chrome://extensions` shows "Noctalia" under Themes), and that the
path you loaded is exactly the path above — if you copied the theme elsewhere,
updates stop.
- **Only part of the UI changes:** Chromium theme colors cover the frame, tabs,
toolbar, bookmark text and the new-tab page; in-page content keeps its own
colors (use the Noctalia GTK templates for the wider desktop).

## Removing the theme

In `chrome://extensions`, remove (trash icon) the "Noctalia" theme, then disable
the template in Noctalia.

## Files

| File | Purpose |
| --- | --- |
| `template.toml` | Noctalia manifest (renders the theme, runs `apply.sh`) |
| `manifest.json` | Chromium theme manifest with Noctalia colors/tints |
| `apply.sh` | Idempotent hook: prints one-time install instructions |

> Note: the `pywalfox` / `pywalfox-beta4` community templates theme *Firefox*
> via an extension; this template is the Chromium equivalent of the CSS-based
> `firefox/` and `zen-browser/` templates.
28 changes: 28 additions & 0 deletions ungoogled-chromium/apply.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail

theme_dir="${XDG_CACHE_HOME:-$HOME/.cache}/noctalia/ungoogled-chromium/theme"
note_file="$theme_dir/INSTALL.txt"

mkdir -p "$theme_dir"

# Chromium themes are just extensions: Noctalia renders manifest.json into
# $theme_dir on every palette change. The browser reads that folder as an
# unpacked theme, so the install path never changes and one manual load is
# enough. This hook only prints the one-time instructions the first time it
# runs (the note file doubles as the idempotency marker).
if [ ! -f "$note_file" ]; then
cat >"$note_file" <<EOF
Noctalia theme for (ungoogled) Chromium — load it once:

1. Open ungoogled-chromium and go to chrome://extensions
2. Enable Developer mode (top-right toggle)
3. Click "Load unpacked" and choose:
$theme_dir

The theme stays installed: it points at this same folder, which Noctalia
rewrites on every palette change. Restart the browser after a theme or
palette update so the new colors are applied.
EOF
echo "Noctalia ungoogled-chromium: load the theme once from chrome://extensions (details in $note_file)" >&2
fi
29 changes: 29 additions & 0 deletions ungoogled-chromium/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"manifest_version": 2,
"name": "Noctalia",
"version": "1.0.0",
"description": "Noctalia palette theme for Chromium (rendered by Noctalia). Load this folder unpacked once: chrome://extensions → Developer mode → Load unpacked.",
"theme": {
"colors": {
"frame": [{{colors.background.default.red}}, {{colors.background.default.green}}, {{colors.background.default.blue}}],
"frame_inactive": [{{colors.surface_dim.default.red}}, {{colors.surface_dim.default.green}}, {{colors.surface_dim.default.blue}}],
"toolbar": [{{colors.surface_container.default.red}}, {{colors.surface_container.default.green}}, {{colors.surface_container.default.blue}}],
"tab_text": [{{colors.on_surface.default.red}}, {{colors.on_surface.default.green}}, {{colors.on_surface.default.blue}}],
"tab_background_text": [{{colors.on_surface_variant.default.red}}, {{colors.on_surface_variant.default.green}}, {{colors.on_surface_variant.default.blue}}],
"bookmark_text": [{{colors.on_surface.default.red}}, {{colors.on_surface.default.green}}, {{colors.on_surface.default.blue}}],
"ntp_background": [{{colors.surface_container_low.default.red}}, {{colors.surface_container_low.default.green}}, {{colors.surface_container_low.default.blue}}],
"ntp_text": [{{colors.on_surface.default.red}}, {{colors.on_surface.default.green}}, {{colors.on_surface.default.blue}}],
"ntp_link": [{{colors.primary.default.red}}, {{colors.primary.default.green}}, {{colors.primary.default.blue}}],
"button_background": [{{colors.surface_container_high.default.red}}, {{colors.surface_container_high.default.green}}, {{colors.surface_container_high.default.blue}}],
"control_background": [{{colors.surface_container.default.red}}, {{colors.surface_container.default.green}}, {{colors.surface_container.default.blue}}]
},
"tints": {
"buttons": [0.15, 0.6, 0.75],
"frame": [-1, -1, -1],
"frame_inactive": [-1, -1, -1],
"tab_text": [-1, -1, -1],
"tab_background_text": [-1, -1, -1],
"toolbar": [-1, -1, -1]
}
}
}
Binary file added ungoogled-chromium/newtab-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ungoogled-chromium/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions ungoogled-chromium/template.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[catalog.ungoogled-chromium]
name = "Ungoogled Chromium"
category = "browser"

[templates.ungoogled_chromium_theme]
input_path = "manifest.json"
output_path = "$XDG_CACHE_HOME/noctalia/ungoogled-chromium/theme/manifest.json"
post_hook = "bash '{{ config_dir }}/apply.sh'"