Skip to content

Commit

Permalink
Enable wallpaper overrides when using a theme
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chriskingio authored and eylles committed Aug 2, 2023
1 parent 5014f82 commit cac505a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pywal/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,6 @@ def parse_args_exit(parser):
colors.palette()
sys.exit(0)

if args.i and args.theme:
parser.error("Conflicting arguments -i and -f.")

if args.r:
reload.colors()
sys.exit(0)
Expand Down Expand Up @@ -175,14 +172,16 @@ def parse_args(parser):
if 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,
recursive=args.recursive)
colors_plain = colors.get(image_file, args.l, args.cols16, args.backend,
sat=args.saturate)

if args.theme:
colors_plain = theme.file(args.theme, args.l)
if args.i:
colors_plain["wallpaper"] = args.i

if args.R:
colors_plain = theme.file(os.path.join(CACHE_DIR, "colors.json"))
Expand Down

0 comments on commit cac505a

Please sign in to comment.