From 78d7d285a980513101210188ab3da8a4c3b512e8 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 22 Oct 2026 17:25:09 +0200 Subject: install: one function per consumer, runnable alone install.sh was one linear script, so the only way to re-theme kitty after it drifted was to reinstall everything. Each consumer is now a c_ function: `./install.sh kitty gtk` runs only those, no argument runs all of them in definition order, and `--list` prints name, software|hardware and what it themes, read off the function lines themselves. quickshell's Theme status page lists and re-applies consumers through those two calls, so a new consumer is a new function and nothing else. udt-accent now runs before the consumers with a new --no-helpers flag. Before it, every install ran it last and it started homepage, GRUB, keyboard, LED strip, bulbs and TV detached, so re-applying conky also repainted the strip. Those helpers are consumers of their own here, run in the foreground so a re-apply reports how it went; wallp still starts them all on a wallpaper change. Running the accent first means c_sublime fills the template's @ACCENT@ itself, from udt-accent.rasi. Co-Authored-By: Claude Opus 5.5 --- bin/udt-accent | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/udt-accent b/bin/udt-accent index ebbac91..aabbdec 100755 --- a/bin/udt-accent +++ b/bin/udt-accent @@ -5,7 +5,7 @@ # Licensed under the GNU General Public License v2 only. """Extract a wallpaper's signature color and snap it to one of the scheme's accents. -Usage: udt-accent +Usage: udt-accent [--no-helpers] udt-accent --selftest udt-accent --help @@ -624,7 +624,7 @@ def write_sddm(name, image): mode=0o644, dir_mode=0o755) -def main(image): +def main(image, helpers=True): try: color = signature_color(image) name = snap(color) if color else FALLBACK @@ -657,7 +657,8 @@ def main(image): # The LED strip waits up to 20 s for its address broadcast, the bulbs # up to 5 s per bulb for the gateway. All of them read files written above; # udt-tv is a single UDP datagram to the TV launcher. - for helper in ("udt-homepage", "udt-grub", "udt-keyboard", "udt-ledstrip", "udt-bulb", "udt-tv"): + # --no-helpers is install.sh's: it runs each of them as a consumer itself. + for helper in ("udt-homepage", "udt-grub", "udt-keyboard", "udt-ledstrip", "udt-bulb", "udt-tv") if helpers else (): subprocess.Popen([Path(__file__).resolve().parent / helper], stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, start_new_session=True) @@ -917,12 +918,15 @@ def selftest(): if __name__ == "__main__": args = sys.argv[1:] + helpers = args[:1] != ["--no-helpers"] + if not helpers: + args = args[1:] if args == ["--selftest"]: selftest() elif args in (["-h"], ["--help"]): print(__doc__) elif len(args) == 1 and not args[0].startswith("-") and os.path.isfile(args[0]): - main(args[0]) + main(args[0], helpers) else: # An unknown option or a missing file would otherwise be taken as the # wallpaper, and its path written into SDDM's config and colors.json. -- cgit v1.2.3