Replace aether with a homegrown theme system + desktop theme widget
aether (the third-party GUI app) is gone - it didn't work reliably. Replaced
with theme/: colors.toml (palette), templates/<app>/ (Hyprland, Kitty, Rofi,
mako; unused Waybar template dropped), render.py (renders + reloads apps,
supports --set/--get/--dump), and wallpaper.py (archives + swaps the
wallpaper, deduped by hash, via a native zenity picker).
New ThemeWidget.qml: a small standalone widget pinned to the top-left corner
of the main monitor, independent of the bar and sitting on the Bottom wlr
layer (so normal windows can cover it). Two buttons - wallpaper gallery/picker,
and a color-role picker with a preset palette + hex input - call straight into
the scripts above.
Also includes an unrelated hyprland.lua fix found while testing the widget:
new kitty windows were coming up in genuine Hyprland fullscreen regardless of
workspace; a fullscreen_state window rule forces it off (plain
'fullscreen = false' turned out to be a no-op).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-28 01:53:04 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
"""Renders theme/colors.toml into every app's real config, replacing the aether GUI app.
|
|
|
|
|
|
|
|
|
|
render.py re-render every template from the current palette and reload apps
|
|
|
|
|
render.py --no-reload same, but skip reloading apps (used right after --set, which reloads itself)
|
|
|
|
|
render.py --dump print every color as JSON (used by ThemeWidget.qml)
|
|
|
|
|
render.py --get KEY print one color (e.g. for shell scripts)
|
Theme presets, and make the bar itself actually re-theme (colors + opacity)
Presets (theme/presets.py): named snapshots of the whole palette, saved/loaded/
deleted from a new bookmark button on the theme widget. Stored outside the
repo in ~/.local/share/quickshell/theme-presets/ (JSON, per-machine data, same
precedent as the wallpaper history). A built-in Default entry can't be
overwritten or deleted.
Wiring that up exposed a real gap: the bar's own colors were hand-matched
hardcoded QML literals, not actually driven by theme/colors.toml, and opacity
wasn't themeable anywhere yet. Fixed both:
- colors.toml gains bar_color/pill_color/popup_color (paired with the existing
*_opacity floats) plus generic opacity support in render.py (--set now
accepts a 0-1 float, not just #rrggbb)
- Bar.qml now fetches the palette via render.py --dump and rebinds every
matching hardcoded hex literal (accent, foreground, color1/2/3/5/6/8/12,
the bar/pill/popup backgrounds, the logo tint and the bar's bottom border)
to it; kitty's background_opacity is template-driven instead of a second
hardcoded line fighting the themed one
- both the bar and the widget listen on their own Quickshell IPC target
(render.py/presets.py ping both after every change) so edits reload with no
restart, matching the "instant" promise the color editor already had
- the theme widget's color popup gained a slider + matching color swatch per
surface (Bar/Pills/Popups/Terminal) below the existing role list, and its
role labels now say what each color actually paints instead of "Color N"
(verified against the templates and Bar.qml's literals, not guessed) with
unused roles honestly marked as such
- the CPU pill's icon color is deliberately hardcoded again after this -
it coincidentally shared color12's hex value with the help icon/detail
text, so theming color12 was recoloring it too
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-28 22:45:09 +02:00
|
|
|
render.py --set KEY VALUE [KEY VALUE ...] change one or more colors/opacities in colors.toml, re-render, reload
|
Replace aether with a homegrown theme system + desktop theme widget
aether (the third-party GUI app) is gone - it didn't work reliably. Replaced
with theme/: colors.toml (palette), templates/<app>/ (Hyprland, Kitty, Rofi,
mako; unused Waybar template dropped), render.py (renders + reloads apps,
supports --set/--get/--dump), and wallpaper.py (archives + swaps the
wallpaper, deduped by hash, via a native zenity picker).
New ThemeWidget.qml: a small standalone widget pinned to the top-left corner
of the main monitor, independent of the bar and sitting on the Bottom wlr
layer (so normal windows can cover it). Two buttons - wallpaper gallery/picker,
and a color-role picker with a preset palette + hex input - call straight into
the scripts above.
Also includes an unrelated hyprland.lua fix found while testing the widget:
new kitty windows were coming up in genuine Hyprland fullscreen regardless of
workspace; a fullscreen_state window rule forces it off (plain
'fullscreen = false' turned out to be a no-op).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-28 01:53:04 +02:00
|
|
|
|
|
|
|
|
Templates live in theme/templates/<app>/{config.json,template}: config.json names the
|
|
|
|
|
template file and the destination it gets rendered to (~ expanded). Placeholders in a
|
Theme KDE/Qt apps (Dolphin, etc.) via kdeglobals
New theme/templates/kde/ renders the KDE color scheme embedded in kdeglobals
(Colors:View/Window/Button/Selection/Tooltip/Complementary + WM), themeing
every KDE/Qt app that reads it, not just Dolphin - kdeglobals was previously a
static, hand-maintained file (still bearing its ColorScheme=AetherRice name
from when the old aether app generated it once). The rendered output is
byte-identical to what was already there, confirming every mapped value was
right.
Needed render.py to grow a {key.rgb} placeholder format ("r,g,b" decimal, no
alpha - what kdeglobals uses, vs. the hex/rgba() formats every other template
needed). A couple of BackgroundAlternate shades don't correspond to any role
in colors.toml and are left as static literals rather than mapped to
something that wouldn't mean the same thing - noted in the template.
reload_apps() now also sends a best-effort dbus-send KGlobalSettings ping;
not every KDE app listens for it, so an already-open Dolphin may still need a
restart to fully pick up a change, same as most apps here.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-28 22:54:45 +02:00
|
|
|
template are {key}, {key.strip} (hex without '#'), {key.rgb} ("r,g,b" decimal, no
|
|
|
|
|
alpha - what KDE's kdeglobals/*.colors files use), or {key.rgba:ALPHA}.
|
Replace aether with a homegrown theme system + desktop theme widget
aether (the third-party GUI app) is gone - it didn't work reliably. Replaced
with theme/: colors.toml (palette), templates/<app>/ (Hyprland, Kitty, Rofi,
mako; unused Waybar template dropped), render.py (renders + reloads apps,
supports --set/--get/--dump), and wallpaper.py (archives + swaps the
wallpaper, deduped by hash, via a native zenity picker).
New ThemeWidget.qml: a small standalone widget pinned to the top-left corner
of the main monitor, independent of the bar and sitting on the Bottom wlr
layer (so normal windows can cover it). Two buttons - wallpaper gallery/picker,
and a color-role picker with a preset palette + hex input - call straight into
the scripts above.
Also includes an unrelated hyprland.lua fix found while testing the widget:
new kitty windows were coming up in genuine Hyprland fullscreen regardless of
workspace; a fullscreen_state window rule forces it off (plain
'fullscreen = false' turned out to be a no-op).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-28 01:53:04 +02:00
|
|
|
"""
|
|
|
|
|
import json
|
|
|
|
|
import os
|
|
|
|
|
import re
|
|
|
|
|
import subprocess
|
|
|
|
|
import sys
|
|
|
|
|
import tomllib
|
|
|
|
|
|
2026-09-29 01:19:42 +02:00
|
|
|
import icon_theme
|
|
|
|
|
|
Replace aether with a homegrown theme system + desktop theme widget
aether (the third-party GUI app) is gone - it didn't work reliably. Replaced
with theme/: colors.toml (palette), templates/<app>/ (Hyprland, Kitty, Rofi,
mako; unused Waybar template dropped), render.py (renders + reloads apps,
supports --set/--get/--dump), and wallpaper.py (archives + swaps the
wallpaper, deduped by hash, via a native zenity picker).
New ThemeWidget.qml: a small standalone widget pinned to the top-left corner
of the main monitor, independent of the bar and sitting on the Bottom wlr
layer (so normal windows can cover it). Two buttons - wallpaper gallery/picker,
and a color-role picker with a preset palette + hex input - call straight into
the scripts above.
Also includes an unrelated hyprland.lua fix found while testing the widget:
new kitty windows were coming up in genuine Hyprland fullscreen regardless of
workspace; a fullscreen_state window rule forces it off (plain
'fullscreen = false' turned out to be a no-op).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-28 01:53:04 +02:00
|
|
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
COLORS = os.path.join(HERE, "colors.toml")
|
|
|
|
|
TEMPLATES = os.path.join(HERE, "templates")
|
|
|
|
|
|
|
|
|
|
PLACEHOLDER = re.compile(r"\{([a-zA-Z0-9_]+)(?:\.([a-zA-Z0-9_]+))?(?::([^}]+))?\}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def load_colors():
|
|
|
|
|
with open(COLORS, "rb") as f:
|
|
|
|
|
return tomllib.load(f)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def hex_to_rgb(hex_color):
|
|
|
|
|
h = hex_color.lstrip("#")
|
|
|
|
|
return tuple(int(h[i:i + 2], 16) for i in (0, 2, 4))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def substitute(text, colors):
|
|
|
|
|
def repl(m):
|
|
|
|
|
key, fmt, arg = m.group(1), m.group(2), m.group(3)
|
|
|
|
|
if key not in colors:
|
|
|
|
|
sys.exit(f"render.py: unknown color key '{key}' in template")
|
|
|
|
|
value = colors[key]
|
|
|
|
|
if fmt is None:
|
Theme presets, and make the bar itself actually re-theme (colors + opacity)
Presets (theme/presets.py): named snapshots of the whole palette, saved/loaded/
deleted from a new bookmark button on the theme widget. Stored outside the
repo in ~/.local/share/quickshell/theme-presets/ (JSON, per-machine data, same
precedent as the wallpaper history). A built-in Default entry can't be
overwritten or deleted.
Wiring that up exposed a real gap: the bar's own colors were hand-matched
hardcoded QML literals, not actually driven by theme/colors.toml, and opacity
wasn't themeable anywhere yet. Fixed both:
- colors.toml gains bar_color/pill_color/popup_color (paired with the existing
*_opacity floats) plus generic opacity support in render.py (--set now
accepts a 0-1 float, not just #rrggbb)
- Bar.qml now fetches the palette via render.py --dump and rebinds every
matching hardcoded hex literal (accent, foreground, color1/2/3/5/6/8/12,
the bar/pill/popup backgrounds, the logo tint and the bar's bottom border)
to it; kitty's background_opacity is template-driven instead of a second
hardcoded line fighting the themed one
- both the bar and the widget listen on their own Quickshell IPC target
(render.py/presets.py ping both after every change) so edits reload with no
restart, matching the "instant" promise the color editor already had
- the theme widget's color popup gained a slider + matching color swatch per
surface (Bar/Pills/Popups/Terminal) below the existing role list, and its
role labels now say what each color actually paints instead of "Color N"
(verified against the templates and Bar.qml's literals, not guessed) with
unused roles honestly marked as such
- the CPU pill's icon color is deliberately hardcoded again after this -
it coincidentally shared color12's hex value with the help icon/detail
text, so theming color12 was recoloring it too
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-28 22:45:09 +02:00
|
|
|
return str(value)
|
|
|
|
|
if not isinstance(value, str):
|
|
|
|
|
sys.exit(f"render.py: '.{fmt}' needs a #rrggbb color, '{key}' is {value!r}")
|
Replace aether with a homegrown theme system + desktop theme widget
aether (the third-party GUI app) is gone - it didn't work reliably. Replaced
with theme/: colors.toml (palette), templates/<app>/ (Hyprland, Kitty, Rofi,
mako; unused Waybar template dropped), render.py (renders + reloads apps,
supports --set/--get/--dump), and wallpaper.py (archives + swaps the
wallpaper, deduped by hash, via a native zenity picker).
New ThemeWidget.qml: a small standalone widget pinned to the top-left corner
of the main monitor, independent of the bar and sitting on the Bottom wlr
layer (so normal windows can cover it). Two buttons - wallpaper gallery/picker,
and a color-role picker with a preset palette + hex input - call straight into
the scripts above.
Also includes an unrelated hyprland.lua fix found while testing the widget:
new kitty windows were coming up in genuine Hyprland fullscreen regardless of
workspace; a fullscreen_state window rule forces it off (plain
'fullscreen = false' turned out to be a no-op).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-28 01:53:04 +02:00
|
|
|
if fmt == "strip":
|
|
|
|
|
return value.lstrip("#")
|
|
|
|
|
if fmt == "rgba":
|
|
|
|
|
r, g, b = hex_to_rgb(value)
|
|
|
|
|
return f"rgba({r}, {g}, {b}, {arg})"
|
Theme KDE/Qt apps (Dolphin, etc.) via kdeglobals
New theme/templates/kde/ renders the KDE color scheme embedded in kdeglobals
(Colors:View/Window/Button/Selection/Tooltip/Complementary + WM), themeing
every KDE/Qt app that reads it, not just Dolphin - kdeglobals was previously a
static, hand-maintained file (still bearing its ColorScheme=AetherRice name
from when the old aether app generated it once). The rendered output is
byte-identical to what was already there, confirming every mapped value was
right.
Needed render.py to grow a {key.rgb} placeholder format ("r,g,b" decimal, no
alpha - what kdeglobals uses, vs. the hex/rgba() formats every other template
needed). A couple of BackgroundAlternate shades don't correspond to any role
in colors.toml and are left as static literals rather than mapped to
something that wouldn't mean the same thing - noted in the template.
reload_apps() now also sends a best-effort dbus-send KGlobalSettings ping;
not every KDE app listens for it, so an already-open Dolphin may still need a
restart to fully pick up a change, same as most apps here.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-28 22:54:45 +02:00
|
|
|
if fmt == "rgb":
|
|
|
|
|
r, g, b = hex_to_rgb(value)
|
|
|
|
|
return f"{r},{g},{b}"
|
Replace aether with a homegrown theme system + desktop theme widget
aether (the third-party GUI app) is gone - it didn't work reliably. Replaced
with theme/: colors.toml (palette), templates/<app>/ (Hyprland, Kitty, Rofi,
mako; unused Waybar template dropped), render.py (renders + reloads apps,
supports --set/--get/--dump), and wallpaper.py (archives + swaps the
wallpaper, deduped by hash, via a native zenity picker).
New ThemeWidget.qml: a small standalone widget pinned to the top-left corner
of the main monitor, independent of the bar and sitting on the Bottom wlr
layer (so normal windows can cover it). Two buttons - wallpaper gallery/picker,
and a color-role picker with a preset palette + hex input - call straight into
the scripts above.
Also includes an unrelated hyprland.lua fix found while testing the widget:
new kitty windows were coming up in genuine Hyprland fullscreen regardless of
workspace; a fullscreen_state window rule forces it off (plain
'fullscreen = false' turned out to be a no-op).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-28 01:53:04 +02:00
|
|
|
sys.exit(f"render.py: unknown placeholder format '.{fmt}' in template")
|
|
|
|
|
return PLACEHOLDER.sub(repl, text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def render_all(colors):
|
|
|
|
|
for app in sorted(os.listdir(TEMPLATES)):
|
|
|
|
|
app_dir = os.path.join(TEMPLATES, app)
|
|
|
|
|
cfg_path = os.path.join(app_dir, "config.json")
|
|
|
|
|
if not os.path.isfile(cfg_path):
|
|
|
|
|
continue
|
|
|
|
|
cfg = json.load(open(cfg_path))
|
|
|
|
|
template = open(os.path.join(app_dir, cfg["template"])).read()
|
|
|
|
|
dest = os.path.expanduser(cfg["destination"])
|
|
|
|
|
os.makedirs(os.path.dirname(dest), exist_ok=True)
|
|
|
|
|
open(dest, "w").write(substitute(template, colors))
|
|
|
|
|
print(f"rendered {app} -> {dest}")
|
2026-09-29 01:19:42 +02:00
|
|
|
icon_theme.render(colors)
|
|
|
|
|
print(f"rendered gtk3-icons -> {icon_theme.DEST_THEME}")
|
Replace aether with a homegrown theme system + desktop theme widget
aether (the third-party GUI app) is gone - it didn't work reliably. Replaced
with theme/: colors.toml (palette), templates/<app>/ (Hyprland, Kitty, Rofi,
mako; unused Waybar template dropped), render.py (renders + reloads apps,
supports --set/--get/--dump), and wallpaper.py (archives + swaps the
wallpaper, deduped by hash, via a native zenity picker).
New ThemeWidget.qml: a small standalone widget pinned to the top-left corner
of the main monitor, independent of the bar and sitting on the Bottom wlr
layer (so normal windows can cover it). Two buttons - wallpaper gallery/picker,
and a color-role picker with a preset palette + hex input - call straight into
the scripts above.
Also includes an unrelated hyprland.lua fix found while testing the widget:
new kitty windows were coming up in genuine Hyprland fullscreen regardless of
workspace; a fullscreen_state window rule forces it off (plain
'fullscreen = false' turned out to be a no-op).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-28 01:53:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def reload_apps():
|
|
|
|
|
subprocess.run(["hyprctl", "reload"], check=False, capture_output=True)
|
|
|
|
|
subprocess.run(["makoctl", "reload"], check=False, capture_output=True)
|
|
|
|
|
subprocess.run(["pkill", "--signal", "USR1", "-x", "kitty"], check=False, capture_output=True)
|
Theme presets, and make the bar itself actually re-theme (colors + opacity)
Presets (theme/presets.py): named snapshots of the whole palette, saved/loaded/
deleted from a new bookmark button on the theme widget. Stored outside the
repo in ~/.local/share/quickshell/theme-presets/ (JSON, per-machine data, same
precedent as the wallpaper history). A built-in Default entry can't be
overwritten or deleted.
Wiring that up exposed a real gap: the bar's own colors were hand-matched
hardcoded QML literals, not actually driven by theme/colors.toml, and opacity
wasn't themeable anywhere yet. Fixed both:
- colors.toml gains bar_color/pill_color/popup_color (paired with the existing
*_opacity floats) plus generic opacity support in render.py (--set now
accepts a 0-1 float, not just #rrggbb)
- Bar.qml now fetches the palette via render.py --dump and rebinds every
matching hardcoded hex literal (accent, foreground, color1/2/3/5/6/8/12,
the bar/pill/popup backgrounds, the logo tint and the bar's bottom border)
to it; kitty's background_opacity is template-driven instead of a second
hardcoded line fighting the themed one
- both the bar and the widget listen on their own Quickshell IPC target
(render.py/presets.py ping both after every change) so edits reload with no
restart, matching the "instant" promise the color editor already had
- the theme widget's color popup gained a slider + matching color swatch per
surface (Bar/Pills/Popups/Terminal) below the existing role list, and its
role labels now say what each color actually paints instead of "Color N"
(verified against the templates and Bar.qml's literals, not guessed) with
unused roles honestly marked as such
- the CPU pill's icon color is deliberately hardcoded again after this -
it coincidentally shared color12's hex value with the help icon/detail
text, so theming color12 was recoloring it too
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-28 22:45:09 +02:00
|
|
|
# Best-effort: tell the running shell (bar + theme widget, two separate IPC targets
|
|
|
|
|
# since they're two separate top-level QML components) to re-fetch the palette, for
|
|
|
|
|
# the bits of it (pill/popup/bar opacity) that only live in QML, not another app's
|
|
|
|
|
# config file. A no-op if quickshell isn't running.
|
|
|
|
|
for target in ("theme", "theme-widget"):
|
|
|
|
|
subprocess.run(["quickshell", "-c", "default", "ipc", "call", target, "changed"],
|
|
|
|
|
check=False, capture_output=True, timeout=3)
|
Theme KDE/Qt apps (Dolphin, etc.) via kdeglobals
New theme/templates/kde/ renders the KDE color scheme embedded in kdeglobals
(Colors:View/Window/Button/Selection/Tooltip/Complementary + WM), themeing
every KDE/Qt app that reads it, not just Dolphin - kdeglobals was previously a
static, hand-maintained file (still bearing its ColorScheme=AetherRice name
from when the old aether app generated it once). The rendered output is
byte-identical to what was already there, confirming every mapped value was
right.
Needed render.py to grow a {key.rgb} placeholder format ("r,g,b" decimal, no
alpha - what kdeglobals uses, vs. the hex/rgba() formats every other template
needed). A couple of BackgroundAlternate shades don't correspond to any role
in colors.toml and are left as static literals rather than mapped to
something that wouldn't mean the same thing - noted in the template.
reload_apps() now also sends a best-effort dbus-send KGlobalSettings ping;
not every KDE app listens for it, so an already-open Dolphin may still need a
restart to fully pick up a change, same as most apps here.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-28 22:54:45 +02:00
|
|
|
# Best-effort: nudge already-running KDE/Qt apps (Dolphin, etc.) to re-read kdeglobals.
|
|
|
|
|
# Not every app listens for this, so a restart is still the reliable way to see it.
|
|
|
|
|
subprocess.run(["dbus-send", "--type=signal", "/KGlobalSettings",
|
|
|
|
|
"org.kde.KGlobalSettings.notifyChange", "int32:0", "int32:0"],
|
|
|
|
|
check=False, capture_output=True, timeout=3)
|
Replace aether with a homegrown theme system + desktop theme widget
aether (the third-party GUI app) is gone - it didn't work reliably. Replaced
with theme/: colors.toml (palette), templates/<app>/ (Hyprland, Kitty, Rofi,
mako; unused Waybar template dropped), render.py (renders + reloads apps,
supports --set/--get/--dump), and wallpaper.py (archives + swaps the
wallpaper, deduped by hash, via a native zenity picker).
New ThemeWidget.qml: a small standalone widget pinned to the top-left corner
of the main monitor, independent of the bar and sitting on the Bottom wlr
layer (so normal windows can cover it). Two buttons - wallpaper gallery/picker,
and a color-role picker with a preset palette + hex input - call straight into
the scripts above.
Also includes an unrelated hyprland.lua fix found while testing the widget:
new kitty windows were coming up in genuine Hyprland fullscreen regardless of
workspace; a fullscreen_state window rule forces it off (plain
'fullscreen = false' turned out to be a no-op).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-28 01:53:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def set_colors(pairs):
|
|
|
|
|
colors = load_colors()
|
|
|
|
|
text = open(COLORS).read()
|
|
|
|
|
for key, value in pairs:
|
|
|
|
|
if key not in colors:
|
|
|
|
|
sys.exit(f"render.py: unknown color key '{key}'")
|
Theme presets, and make the bar itself actually re-theme (colors + opacity)
Presets (theme/presets.py): named snapshots of the whole palette, saved/loaded/
deleted from a new bookmark button on the theme widget. Stored outside the
repo in ~/.local/share/quickshell/theme-presets/ (JSON, per-machine data, same
precedent as the wallpaper history). A built-in Default entry can't be
overwritten or deleted.
Wiring that up exposed a real gap: the bar's own colors were hand-matched
hardcoded QML literals, not actually driven by theme/colors.toml, and opacity
wasn't themeable anywhere yet. Fixed both:
- colors.toml gains bar_color/pill_color/popup_color (paired with the existing
*_opacity floats) plus generic opacity support in render.py (--set now
accepts a 0-1 float, not just #rrggbb)
- Bar.qml now fetches the palette via render.py --dump and rebinds every
matching hardcoded hex literal (accent, foreground, color1/2/3/5/6/8/12,
the bar/pill/popup backgrounds, the logo tint and the bar's bottom border)
to it; kitty's background_opacity is template-driven instead of a second
hardcoded line fighting the themed one
- both the bar and the widget listen on their own Quickshell IPC target
(render.py/presets.py ping both after every change) so edits reload with no
restart, matching the "instant" promise the color editor already had
- the theme widget's color popup gained a slider + matching color swatch per
surface (Bar/Pills/Popups/Terminal) below the existing role list, and its
role labels now say what each color actually paints instead of "Color N"
(verified against the templates and Bar.qml's literals, not guessed) with
unused roles honestly marked as such
- the CPU pill's icon color is deliberately hardcoded again after this -
it coincidentally shared color12's hex value with the help icon/detail
text, so theming color12 was recoloring it too
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-28 22:45:09 +02:00
|
|
|
if isinstance(colors[key], str):
|
|
|
|
|
if not re.fullmatch(r"#[0-9a-fA-F]{6}", value):
|
|
|
|
|
sys.exit(f"render.py: '{value}' is not a #rrggbb color")
|
|
|
|
|
literal = f'"{value.lower()}"'
|
|
|
|
|
pattern = r'"#[0-9a-fA-F]{6}"'
|
|
|
|
|
else:
|
|
|
|
|
try:
|
|
|
|
|
v = float(value)
|
|
|
|
|
except ValueError:
|
|
|
|
|
sys.exit(f"render.py: '{value}' is not a number (expected 0-1, for '{key}')")
|
|
|
|
|
if not 0 <= v <= 1:
|
|
|
|
|
sys.exit(f"render.py: '{value}' is out of range (expected 0-1, for '{key}')")
|
|
|
|
|
literal = repr(v)
|
|
|
|
|
pattern = r"[0-9]*\.?[0-9]+"
|
|
|
|
|
new_text, n = re.subn(rf"(?m)^{re.escape(key)}\s*=\s*{pattern}",
|
|
|
|
|
f"{key} = {literal}", text)
|
Replace aether with a homegrown theme system + desktop theme widget
aether (the third-party GUI app) is gone - it didn't work reliably. Replaced
with theme/: colors.toml (palette), templates/<app>/ (Hyprland, Kitty, Rofi,
mako; unused Waybar template dropped), render.py (renders + reloads apps,
supports --set/--get/--dump), and wallpaper.py (archives + swaps the
wallpaper, deduped by hash, via a native zenity picker).
New ThemeWidget.qml: a small standalone widget pinned to the top-left corner
of the main monitor, independent of the bar and sitting on the Bottom wlr
layer (so normal windows can cover it). Two buttons - wallpaper gallery/picker,
and a color-role picker with a preset palette + hex input - call straight into
the scripts above.
Also includes an unrelated hyprland.lua fix found while testing the widget:
new kitty windows were coming up in genuine Hyprland fullscreen regardless of
workspace; a fullscreen_state window rule forces it off (plain
'fullscreen = false' turned out to be a no-op).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-28 01:53:04 +02:00
|
|
|
if n != 1:
|
Theme presets, and make the bar itself actually re-theme (colors + opacity)
Presets (theme/presets.py): named snapshots of the whole palette, saved/loaded/
deleted from a new bookmark button on the theme widget. Stored outside the
repo in ~/.local/share/quickshell/theme-presets/ (JSON, per-machine data, same
precedent as the wallpaper history). A built-in Default entry can't be
overwritten or deleted.
Wiring that up exposed a real gap: the bar's own colors were hand-matched
hardcoded QML literals, not actually driven by theme/colors.toml, and opacity
wasn't themeable anywhere yet. Fixed both:
- colors.toml gains bar_color/pill_color/popup_color (paired with the existing
*_opacity floats) plus generic opacity support in render.py (--set now
accepts a 0-1 float, not just #rrggbb)
- Bar.qml now fetches the palette via render.py --dump and rebinds every
matching hardcoded hex literal (accent, foreground, color1/2/3/5/6/8/12,
the bar/pill/popup backgrounds, the logo tint and the bar's bottom border)
to it; kitty's background_opacity is template-driven instead of a second
hardcoded line fighting the themed one
- both the bar and the widget listen on their own Quickshell IPC target
(render.py/presets.py ping both after every change) so edits reload with no
restart, matching the "instant" promise the color editor already had
- the theme widget's color popup gained a slider + matching color swatch per
surface (Bar/Pills/Popups/Terminal) below the existing role list, and its
role labels now say what each color actually paints instead of "Color N"
(verified against the templates and Bar.qml's literals, not guessed) with
unused roles honestly marked as such
- the CPU pill's icon color is deliberately hardcoded again after this -
it coincidentally shared color12's hex value with the help icon/detail
text, so theming color12 was recoloring it too
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-28 22:45:09 +02:00
|
|
|
sys.exit(f"render.py: could not find a single '{key} = ...' line to replace")
|
Replace aether with a homegrown theme system + desktop theme widget
aether (the third-party GUI app) is gone - it didn't work reliably. Replaced
with theme/: colors.toml (palette), templates/<app>/ (Hyprland, Kitty, Rofi,
mako; unused Waybar template dropped), render.py (renders + reloads apps,
supports --set/--get/--dump), and wallpaper.py (archives + swaps the
wallpaper, deduped by hash, via a native zenity picker).
New ThemeWidget.qml: a small standalone widget pinned to the top-left corner
of the main monitor, independent of the bar and sitting on the Bottom wlr
layer (so normal windows can cover it). Two buttons - wallpaper gallery/picker,
and a color-role picker with a preset palette + hex input - call straight into
the scripts above.
Also includes an unrelated hyprland.lua fix found while testing the widget:
new kitty windows were coming up in genuine Hyprland fullscreen regardless of
workspace; a fullscreen_state window rule forces it off (plain
'fullscreen = false' turned out to be a no-op).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-28 01:53:04 +02:00
|
|
|
text = new_text
|
|
|
|
|
open(COLORS, "w").write(text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
|
args = sys.argv[1:]
|
|
|
|
|
if args[:1] == ["--dump"]:
|
|
|
|
|
print(json.dumps(load_colors()))
|
|
|
|
|
return
|
|
|
|
|
if args[:1] == ["--get"]:
|
|
|
|
|
colors = load_colors()
|
|
|
|
|
key = args[1]
|
|
|
|
|
if key not in colors:
|
|
|
|
|
sys.exit(f"render.py: unknown color key '{key}'")
|
|
|
|
|
print(colors[key])
|
|
|
|
|
return
|
|
|
|
|
if args[:1] == ["--set"]:
|
|
|
|
|
rest = args[1:]
|
|
|
|
|
if len(rest) % 2 != 0 or not rest:
|
|
|
|
|
sys.exit("usage: render.py --set KEY VALUE [KEY VALUE ...]")
|
|
|
|
|
pairs = list(zip(rest[0::2], rest[1::2]))
|
|
|
|
|
set_colors(pairs)
|
|
|
|
|
render_all(load_colors())
|
|
|
|
|
reload_apps()
|
|
|
|
|
return
|
|
|
|
|
render_all(load_colors())
|
|
|
|
|
if "--no-reload" not in args:
|
|
|
|
|
reload_apps()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
main()
|