aboutsummaryrefslogtreecommitdiffstats
path: root/bin/udt-accent
diff options
context:
space:
mode:
Diffstat (limited to 'bin/udt-accent')
-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.