diff --git a/apps/zen.nix b/apps/zen.nix index 6170191..2592a57 100644 --- a/apps/zen.nix +++ b/apps/zen.nix @@ -11,10 +11,11 @@ let # that is what makes a `theme-apply` switch land in a running Zen # (settings/theming.nix writes that file on every switch). # - # userChrome.css can't stay as a safety net: nsIStyleSheetService user - # sheets are ordered BEFORE the profile's userChrome.css, so a leftover copy - # would outrank every sheet we register and pin Zen to whichever wallpaper - # was live at startup — the exact bug this fixes. + # theming.nix still writes userChrome.css too, so a broken watcher costs the + # live update and nothing else. Whether the watcher can win at all is the + # open question: nsIStyleSheetService documents its user sheets as ordered + # BEFORE the profile's userChrome.css, which would let the startup copy + # outrank every sheet we register. # # Everything here goes through Components.classes. The autoconfig sandbox is # not a normal system-principal scope: `Services` is not a global in it, and diff --git a/settings/theming.nix b/settings/theming.nix index ba53d28..65f64dd 100644 --- a/settings/theming.nix +++ b/settings/theming.nix @@ -519,12 +519,15 @@ let # 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" - # zen-theme.css, not userChrome.css: Zen's autoconfig script watches this - # file's mtime and re-registers it as a style sheet, so a switch lands in - # the running window (see apps/zen.nix). A userChrome.css copy would keep - # loading the wallpaper that was live at startup and fight it. + # Two copies, on purpose. userChrome.css is the one Gecko loads at startup + # and always themes the window. zen-theme.css is the same CSS under a name + # Zen's autoconfig watcher owns: it re-registers that file as a style sheet + # whenever its mtime moves, which is what can land a switch in a running + # window (see apps/zen.nix). If the watcher loses the cascade to + # userChrome.css the result is the old behaviour — themed on next launch — + # never an unthemed browser. + install -Dm644 "$theme/zen.css" "$HOME/${zenChrome}/userChrome.css" install -Dm644 "$theme/zen.css" "$HOME/${zenChrome}/zen-theme.css" - rm -f "$HOME/${zenChrome}/userChrome.css" # Icon theme: replace the directory contents (cheap — the tree is # symlinks into the papirus store path) so GTK's icon-theme monitor sees