From 76ec7f6cdc1df7a36acae2aa226c83cdc3e5d966 Mon Sep 17 00:00:00 2001 From: Paul Bienkowski Date: Wed, 28 Jun 2017 14:35:28 +0200 Subject: main: add -f flag to read colorscheme from file --- pywal/__main__.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pywal/__main__.py b/pywal/__main__.py index e31fb5d..f9341a5 100755 --- a/pywal/__main__.py +++ b/pywal/__main__.py @@ -27,6 +27,9 @@ def get_args(): arg.add_argument("-i", metavar="\"/path/to/img.jpg\"", help="Which image or directory to use.") + arg.add_argument("-f", metavar="\"/path/to/colorscheme/file\"", + help="Which colorscheme file to use.") + arg.add_argument("-n", action="store_true", help="Skip setting the wallpaper.") @@ -58,6 +61,11 @@ def process_args(args): " Refer to \"wal -h\" for more info.") exit(1) + if args.i and args.f: + print("error: conflicting arguments -i and -f.\n" + " Refer to \"wal -h\" for more info.") + exit(1) + # -q if args.q: sys.stdout = sys.stderr = open(os.devnull, "w") @@ -91,6 +99,12 @@ def process_args(args): set_colors.send_sequences(colors_plain, args.t) export_colors.export_colors(colors_plain) + # -f + elif args.f: + colors_plain = util.read_file(args.f) + set_colors.send_sequences(colors_plain, args.t) + export_colors.export_colors(colors_plain) + # -o if args.o: util.disown(args.o) -- cgit v1.2.3