From c0fd6deff2f88544cd492ca01fadf70118d78e5f Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 1 Feb 2018 11:53:43 +1100 Subject: [PATCH] theme: Don't use oomox by default. -g now does the inverse. --- pywal/__main__.py | 6 +++--- pywal/reload.py | 14 ++++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/pywal/__main__.py b/pywal/__main__.py index 43d438e..283b47f 100644 --- a/pywal/__main__.py +++ b/pywal/__main__.py @@ -46,7 +46,7 @@ def get_args(args): help="Which colorscheme file to use.") arg.add_argument("-g", action="store_true", - help="Skip generating oomox theme.") + help="Generate an oomox theme.") arg.add_argument("-n", action="store_true", help="Skip setting the wallpaper.") @@ -146,8 +146,8 @@ def process_args(args): if args.o: util.disown([args.o]) - if not args.e and not args.g: - reload.oomox() + if not args.e: + reload.oomox(args.g) reload.gtk() diff --git a/pywal/reload.py b/pywal/reload.py index 6b2f1bb..9426cfb 100644 --- a/pywal/reload.py +++ b/pywal/reload.py @@ -28,16 +28,22 @@ def xrdb(xrdb_files=None): subprocess.run(["xrdb", "-merge", "-nocpp", file]) -def oomox(): +def oomox(gen_theme): """Call oomox to generate a theme.""" - oomox_file = os.path.join(CACHE_DIR, "colors-oomox") + if gen_theme: + if not shutil.which("oomox-cli"): + print("gtk: oomox not found, skipping...") + return + + oomox_file = os.path.join(CACHE_DIR, "colors-oomox") - if shutil.which("oomox-cli"): print("reload: Waiting for oomox...") - print("reload: Use -g to skip running oomox.") subprocess.run(["oomox-cli", "-o", "wal", oomox_file], stdout=subprocess.DEVNULL) + else: + print("gtk: Use -g to generate an oomox theme.") + def gtk(): """Reload GTK theme on the fly."""