Skip to content

Commit

Permalink
Make wal -R understand the -l flag, add -d flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenz Leitner committed Sep 10, 2019
1 parent 70c45f5 commit 1bd5542
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pywal/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1bd5542

Please sign in to comment.