diff options
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/udt-accent | 19 |
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) |
