aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--pywal/__main__.py9
2 files changed, 9 insertions, 1 deletions
diff --git a/README.md b/README.md
index a6ccef4..0e14f97 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,6 @@
<p align="center">Generate and change color-schemes on the fly.</p>
<p align="center">
-<a href="https://discord.gg/fK3RhsD"><img src="https://img.shields.io/discord/440354555197128704.svg"></a>
<a href="https://travis-ci.org/dylanaraps/pywal"><img src="https://travis-ci.org/dylanaraps/pywal.svg?branch=master"></a>
<a href="./LICENSE.md"><img src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
<a href="https://pypi.python.org/pypi/pywal/"><img src="https://img.shields.io/pypi/v/pywal.svg"></a>
diff --git a/pywal/__main__.py b/pywal/__main__.py
index de992b7..0f0f077 100644
--- a/pywal/__main__.py
+++ b/pywal/__main__.py
@@ -101,6 +101,9 @@ def get_args():
arg.add_argument("-v", action="store_true",
help="Print \"wal\" version.")
+ arg.add_argument("-w", action="store_true",
+ help="Use last used wallpaper for color generation.")
+
arg.add_argument("-e", action="store_true",
help="Skip reloading gtk/xrdb/i3/sway/polybar")
@@ -138,6 +141,7 @@ def parse_args_exit(parser):
if not args.i and \
not args.theme and \
not args.R and \
+ not args.w and \
not args.backend:
parser.error("No input specified.\n"
"--backend, --theme, -i or -R are required.")
@@ -175,6 +179,11 @@ def parse_args(parser):
if args.R:
colors_plain = theme.file(os.path.join(CACHE_DIR, "colors.json"))
+ if args.w:
+ cached_wallpaper = util.read_file(os.path.join(CACHE_DIR, "wal"))
+ colors_plain = colors.get(cached_wallpaper[0], args.l, args.backend,
+ sat=args.saturate)
+
if args.b:
args.b = "#%s" % (args.b.strip("#"))
colors_plain["special"]["background"] = args.b