summaryrefslogtreecommitdiff
path: root/pywal/__main__.py
diff options
context:
space:
mode:
authorLorenz Leitner <lorenz.leitner@student.tugraz.at>2019-09-10 18:09:43 +0200
committerLorenz Leitner <lorenz.leitner@student.tugraz.at>2019-09-10 18:09:43 +0200
commit1bd5542beb1d43d49549675c1040167f8874722e (patch)
tree6f7532a2a6b89d858f4c8a1779161ac7d42fc75a /pywal/__main__.py
parent70c45f580e4c8223dbf66d53be551d8db2cc2f0a (diff)
Make wal -R understand the -l flag, add -d flag
https://github.com/dylanaraps/pywal/issues/441
Diffstat (limited to 'pywal/__main__.py')
-rw-r--r--pywal/__main__.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/pywal/__main__.py b/pywal/__main__.py
index de992b7..af0770c 100644
--- a/pywal/__main__.py
+++ b/pywal/__main__.py
@@ -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