export: Export a custom font.

This commit is contained in:
Dylan Araps 2017-08-15 19:32:40 +10:00
parent 36e1c9d402
commit 4f76548907
3 changed files with 7 additions and 0 deletions

View File

@ -45,6 +45,10 @@ def get_args(args):
arg.add_argument("-f", metavar="\"/path/to/colorscheme/file\"",
help="Which colorscheme file to use.")
arg.add_argument("--font", metavar="\"font-name\"",
help="Which font to use in export files. \
(Must follow \"fc-list : family\" format.")
arg.add_argument("-n", action="store_true",
help="Skip setting the wallpaper.")
@ -129,6 +133,7 @@ def process_args(args):
if not args.n:
wallpaper.change(colors_plain["wallpaper"])
colors_plain["font"] = args.font or "None"
export.every(colors_plain)
if not args.e:

View File

@ -20,6 +20,7 @@ def flatten_colors(colors):
"""Prepare colors to be exported.
Flatten dicts and convert colors to util.Color()"""
all_colors = {"wallpaper": colors["wallpaper"],
"font": colors["font"],
**colors["special"],
**colors["colors"]}
return {k: util.Color(v) for k, v in all_colors.items()}

View File

@ -1,5 +1,6 @@
{{
"wallpaper": "{wallpaper}",
"font": "{font}",
"special": {{
"background": "{background}",