mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-05-29 22:18:49 +02:00
Enable wallpaper overrides when using a theme
Change such that `--theme` and `-i` no longer conflict; instead the `-i` flag will act as an override for the wallpaper of the theme. This has the added benefit of not rendering templates with a None value (such as `$wallpaper` in `sway-colors` when a wallpaper isn't defined.
This commit is contained in:
parent
236aa48e74
commit
6c909b7461
@ -131,9 +131,6 @@ def parse_args_exit(parser):
|
|||||||
colors.palette()
|
colors.palette()
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
if args.i and args.theme:
|
|
||||||
parser.error("Conflicting arguments -i and -f.")
|
|
||||||
|
|
||||||
if args.r:
|
if args.r:
|
||||||
reload.colors()
|
reload.colors()
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
@ -172,7 +169,7 @@ def parse_args(parser):
|
|||||||
if args.a:
|
if args.a:
|
||||||
util.Color.alpha_num = args.a
|
util.Color.alpha_num = args.a
|
||||||
|
|
||||||
if args.i:
|
if args.i and not args.theme:
|
||||||
image_file = image.get(args.i, iterative=args.iterative,
|
image_file = image.get(args.i, iterative=args.iterative,
|
||||||
recursive=args.recursive)
|
recursive=args.recursive)
|
||||||
colors_plain = colors.get(image_file, args.l, args.backend,
|
colors_plain = colors.get(image_file, args.l, args.backend,
|
||||||
@ -180,6 +177,8 @@ def parse_args(parser):
|
|||||||
|
|
||||||
if args.theme:
|
if args.theme:
|
||||||
colors_plain = theme.file(args.theme, args.l)
|
colors_plain = theme.file(args.theme, args.l)
|
||||||
|
if args.i:
|
||||||
|
colors_plain["wallpaper"] = args.i
|
||||||
|
|
||||||
if args.R:
|
if args.R:
|
||||||
colors_plain = theme.file(os.path.join(CACHE_DIR, "colors.json"))
|
colors_plain = theme.file(os.path.join(CACHE_DIR, "colors.json"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user