Make wal -R understand the -l flag, add -d flag

https://github.com/dylanaraps/pywal/issues/441
This commit is contained in:
Lorenz Leitner 2019-09-10 18:09:43 +02:00
parent 70c45f580e
commit 1bd5542beb

View File

@ -76,6 +76,9 @@ def get_args():
arg.add_argument("-l", action="store_true",
help="Generate a light colorscheme.")
arg.add_argument("-d", action="store_true",
help="Generate a dark colorscheme. Default.")
arg.add_argument("-n", action="store_true",
help="Skip setting the wallpaper.")
@ -175,6 +178,17 @@ def parse_args(parser):
if args.R:
colors_plain = theme.file(os.path.join(CACHE_DIR, "colors.json"))
if args.l:
f = open(os.path.join(CACHE_DIR, "wal"))
cached_wallpaper = f.read()
colors_plain = colors.get(cached_wallpaper, True, args.backend,
sat=args.saturate)
elif args.d:
f = open(os.path.join(CACHE_DIR, "wal"))
cached_wallpaper = f.read()
colors_plain = colors.get(cached_wallpaper, False, args.backend,
sat=args.saturate)
if args.b:
args.b = "#%s" % (args.b.strip("#"))
colors_plain["special"]["background"] = args.b