From 2d6bc39e822bd691e1393f7ae8af7098b56d658d Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 5 Oct 2026 19:09:28 +0200 Subject: fix(firefox): copy the wallpaper, Firefox won't follow the link The darknix.png symlink out of the profile left the new tab blank, even after a restart: Firefox's sandbox does not follow it. udt-accent now copies the wallpaper over the slot on every change instead, removing any leftover link first so the copy cannot write through it into the wallpaper. install.sh no longer makes the link. Co-Authored-By: Claude Opus 5.5 --- bin/udt-accent | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'bin') diff --git a/bin/udt-accent b/bin/udt-accent index 69698d1..2dfc9a0 100755 --- a/bin/udt-accent +++ b/bin/udt-accent @@ -19,6 +19,7 @@ import json import math import os import re +import shutil import subprocess import sys import tempfile @@ -63,6 +64,8 @@ PALETTE_RASI = Path.home() / ".config" / "rofi" / "udt" / "palette.rasi" # install.sh symlinks ~/.cache/wal/colors.json here, so the real file lives # with the rest of the palette and ~/.cache/wal holds nothing but that link. COLORS_JSON = CACHE / "colors.json" +# FF Ultima's new tab background slots. darknix.png is the one udt fills. +FIREFOX_WALLS = "chrome/theme/color-schemes/walls" # The SDDM theme's live palette. ~/.cache is 0700 and unreachable to the sddm # user, ~/.local/share is 0755, so the file has to live here. Root symlinks @@ -387,6 +390,21 @@ def write_colors_json(name, image): subprocess.run(["pywalfox", "update"], capture_output=True, check=False) +def write_firefox(image): + """Copy the wallpaper into FF Ultima's darknix.png new tab slot. + + A copy, not a link: Firefox's sandbox refuses to follow a symlink out of + the profile, and the new tab shows nothing. Every profile without FF + Ultima is skipped. + """ + for walls in (Path.home() / ".mozilla" / "firefox").glob(f"*/{FIREFOX_WALLS}"): + dest = walls / "darknix.png" + # A leftover link would make copyfile write through it into the + # wallpaper itself. + dest.unlink(missing_ok=True) + shutil.copyfile(image, dest) + + def rewrite(path, pattern, value): """Replace group 1's tail in the first line matching pattern with value. @@ -541,6 +559,7 @@ def main(image): write_sublime(name) write_sddm(name, image) write_colors_json(name, image) + write_firefox(image) # Before the helpers below start, which build and stage these two. write_grub(name) write_homepage(name) -- cgit v1.2.3