aboutsummaryrefslogtreecommitdiffstats
path: root/bin/udt-accent
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-05 19:09:28 +0200
committerDanilo M. <danix@danix.xyz>2026-10-05 19:09:28 +0200
commit2d6bc39e822bd691e1393f7ae8af7098b56d658d (patch)
treeb0a382277ac7fd51b3b7e159298eac05408adc78 /bin/udt-accent
parent8cffa0ce6348255e3e917fa26d30b16552fe6262 (diff)
downloadunified-desktop-theme-2d6bc39e822bd691e1393f7ae8af7098b56d658d.tar.gz
unified-desktop-theme-2d6bc39e822bd691e1393f7ae8af7098b56d658d.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'bin/udt-accent')
-rwxr-xr-xbin/udt-accent19
1 files changed, 19 insertions, 0 deletions
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)