mirror of
https://github.com/dylanaraps/pywal.git
synced 2024-11-25 17:33:09 +01:00
args: Added -R to restore the scheme.
This commit is contained in:
parent
c68057ec48
commit
fda6f3a051
@ -58,6 +58,9 @@ def get_args(args):
|
||||
arg.add_argument("-r", action="store_true",
|
||||
help="Reload current colorscheme.")
|
||||
|
||||
arg.add_argument("-R", action="store_true",
|
||||
help="Restore previous theme.")
|
||||
|
||||
arg.add_argument("-t", action="store_true",
|
||||
help="Fix artifacts in VTE Terminals. \
|
||||
(Termite, xfce4-terminal)")
|
||||
@ -99,6 +102,15 @@ def process_args(args):
|
||||
if args.a:
|
||||
util.Color.alpha_num = args.a
|
||||
|
||||
if args.R:
|
||||
image_file = os.path.join(CACHE_DIR, "wal")
|
||||
|
||||
if os.path.isfile(image_file):
|
||||
args.i = util.read_file(image_file)[0]
|
||||
else:
|
||||
print("image: No colorscheme to restore, try 'wal -i' first.")
|
||||
sys.exit(1)
|
||||
|
||||
if args.i:
|
||||
image_file = image.get(args.i)
|
||||
colors_plain = colors.get(image_file, notify=not args.q)
|
||||
|
Loading…
Reference in New Issue
Block a user