From a6b4646f9e710a818664efaa3a8a8a4b620d400e Mon Sep 17 00:00:00 2001 From: rope Date: Thu, 20 Aug 2026 09:37:18 +0100 Subject: [PATCH] theming: write vesktop quickCss in place, live re-theme without Ctrl+R Co-Authored-By: Claude Fable 5 --- settings/theming.nix | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/settings/theming.nix b/settings/theming.nix index 9647deb..af32206 100644 --- a/settings/theming.nix +++ b/settings/theming.nix @@ -466,7 +466,12 @@ let # be applied after Midnight to win, and vencord injects quickCss after # themes. Shipping the same CSS as a theme instead puts it in the same # cascade slot as Midnight, where load order decides and we lose. - install -Dm644 "$theme/vesktop.css" "$HOME/.config/vesktop/settings/quickCss.css" + # Written IN PLACE (cat >), not install: vencord's fs.watch is inotify on + # the inode, and install unlinks+recreates — new inode, watch left on the + # dead one, so only the first switch per vesktop run ever landed. Keeping + # the inode keeps the watch, and vencord hot-swaps quickCss with no reload. + mkdir -p "$HOME/.config/vesktop/settings" + cat "$theme/vesktop.css" > "$HOME/.config/vesktop/settings/quickCss.css" install -Dm644 "$theme/zen.css" "$HOME/${zenChrome}/userChrome.css" # Icon theme: replace the directory contents (cheap — the tree is @@ -511,21 +516,10 @@ let fi fi - # Vesktop: the file above is always correct, but vencord watches it with - # fs.watch on the FILE and delivers one event per vesktop run here, so - # every switch after the first is ignored. (Not our writes — a standalone - # fs.watch sees all of them.) Reloading the renderer re-runs - # VencordInitFileWatchers, which re-reads quickCss and rebinds the watch. - # - # Ctrl+R is Electron's reload accelerator, and it is the same thing that - # works by hand. Cost: discord visibly reloads for a second or two on - # every switch. Delete these three lines if that annoys more than the - # stale colours do. - if ${pkgs.hyprland}/bin/hyprctl -j clients 2>/dev/null \ - | ${pkgs.jq}/bin/jq -e 'any(.[].class; test("^[Vv]esktop$"))' >/dev/null 2>&1; then - ${pkgs.hyprland}/bin/hyprctl dispatch sendshortcut 'CTRL, R, class:^([Vv]esktop)$' \ - || echo "vesktop sendshortcut failed" - fi + # No vesktop reload needed: the in-place quickCss write above keeps + # vencord's file watch alive, so the CSS hot-swaps in the running window. + # (The old install-based write replaced the inode, killed the watch after + # one event, and needed a Ctrl+R sendshortcut here — which dropped calls.) # Point GTK3 at this wallpaper's theme. Every wallpaper has its own theme # name, so this is always a real change: gsettings emits, the portal