summaryrefslogtreecommitdiff
path: root/pywal/__main__.py
diff options
context:
space:
mode:
authordylan <dylan.araps@gmail.com>2020-01-23 10:36:13 +0200
committerGitHub <noreply@github.com>2020-01-23 10:36:13 +0200
commit3537e8cc8f2af2051dd695ef1ca7247e76e0f74f (patch)
tree86197b64788395a3c9908c38cdbb31c1f39c6bdb /pywal/__main__.py
parentca389ce114d73ea9f46f02b3e611fdc1fab26186 (diff)
parent85526b657107c8fa08861a6c6ef3790c5bc14fac (diff)
Merge pull request #389 from aschey/theme_save
New features- saving user themes and loading random user themes
Diffstat (limited to 'pywal/__main__.py')
-rw-r--r--pywal/__main__.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/pywal/__main__.py b/pywal/__main__.py
index 0f0f077..91ead11 100644
--- a/pywal/__main__.py
+++ b/pywal/__main__.py
@@ -45,7 +45,7 @@ def get_args():
arg.add_argument("--theme", "-f", metavar="/path/to/file or theme_name",
help="Which colorscheme file to use. \
- Use 'wal --theme' to list builtin themes.",
+ Use 'wal --theme' to list builtin and user themes.",
const="list_themes", nargs="?")
arg.add_argument("--iterative", action="store_true",
@@ -82,6 +82,11 @@ def get_args():
arg.add_argument("-o", metavar="\"script_name\"", action="append",
help="External script to run after \"wal\".")
+ arg.add_argument("-p", metavar="\"theme_name\"",
+ help="permanently save theme to "
+ "$XDG_CONFIG_HOME/wal/colorschemes with "
+ "the specified name")
+
arg.add_argument("-q", action="store_true",
help="Quiet mode, don\'t print anything.")
@@ -192,6 +197,9 @@ def parse_args(parser):
if not args.n:
wallpaper.change(colors_plain["wallpaper"])
+ if args.p:
+ theme.save(colors_plain, args.p, args.l)
+
sequences.send(colors_plain, to_send=not args.s, vte_fix=args.vte)
if sys.stdout.isatty():