From 4f76548907eec4a4a2a2962a0afe596deab97206 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 15 Aug 2017 19:32:40 +1000 Subject: [PATCH] export: Export a custom font. --- pywal/__main__.py | 5 +++++ pywal/export.py | 1 + pywal/templates/colors.json | 1 + 3 files changed, 7 insertions(+) diff --git a/pywal/__main__.py b/pywal/__main__.py index cbb0ba6..82b0f27 100644 --- a/pywal/__main__.py +++ b/pywal/__main__.py @@ -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: diff --git a/pywal/export.py b/pywal/export.py index d2db143..ebd9463 100644 --- a/pywal/export.py +++ b/pywal/export.py @@ -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()} diff --git a/pywal/templates/colors.json b/pywal/templates/colors.json index 5c94bc4..6efabb4 100644 --- a/pywal/templates/colors.json +++ b/pywal/templates/colors.json @@ -1,5 +1,6 @@ {{ "wallpaper": "{wallpaper}", + "font": "{font}", "special": {{ "background": "{background}",