theme: Don't use oomox by default. -g now does the inverse.

This commit is contained in:
Dylan Araps 2018-02-01 11:53:43 +11:00
parent a671152ff5
commit c0fd6deff2
2 changed files with 13 additions and 7 deletions

View File

@ -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()

View File

@ -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."""
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."""