aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-22 17:25:09 +0200
committerDanilo M. <danix@danix.xyz>2026-10-22 17:25:09 +0200
commit78d7d285a980513101210188ab3da8a4c3b512e8 (patch)
tree3e2d2f395c16afa70bd2f48af0f135c9569d88f2 /bin
parent6b6ac80c924325f1229bf7f230fd80cde0ce7744 (diff)
downloadunified-desktop-theme-78d7d285a980513101210188ab3da8a4c3b512e8.tar.gz
unified-desktop-theme-78d7d285a980513101210188ab3da8a4c3b512e8.zip
install: one function per consumer, runnable aloneHEADmaster
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_<name> 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 <noreply@anthropic.com>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/udt-accent12
1 files changed, 8 insertions, 4 deletions
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 <wallpaper-path>
+Usage: udt-accent [--no-helpers] <wallpaper-path>
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.