From 1ff772a01b1a4f435a28b5fe616bcf4812205a6c Mon Sep 17 00:00:00 2001 From: Bailey Kasin Date: Wed, 30 Aug 2023 00:46:44 -0700 Subject: [PATCH] [+] Add ability to set backend args in config file Adds the option to set permanent backend args in the config file, as requested in #180. --- hyfetch/main.py | 4 +++- hyfetch/models.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hyfetch/main.py b/hyfetch/main.py index 3462e06d..f1b89ecf 100755 --- a/hyfetch/main.py +++ b/hyfetch/main.py @@ -401,6 +401,8 @@ def run(): config.mode = args.mode if args.backend: config.backend = args.backend + if args.args: + config.args = args.args # Override global color mode GLOBAL_CFG.color_mode = config.mode @@ -421,7 +423,7 @@ def run(): try: asc = get_distro_ascii() if not args.ascii_file else Path(args.ascii_file).read_text("utf-8") asc = config.color_align.recolor_ascii(asc, preset) - neofetch_util.run(asc, config.backend, args.args or '') + neofetch_util.run(asc, config.backend, config.args or '') except Exception as e: print(f'Error: {e}') traceback.print_exc() diff --git a/hyfetch/models.py b/hyfetch/models.py index 7050e3b0..9f3a747d 100644 --- a/hyfetch/models.py +++ b/hyfetch/models.py @@ -16,6 +16,7 @@ class Config: lightness: float | None = None color_align: ColorAlignment = field(default_factory=lambda: ColorAlignment('horizontal')) backend: BackendLiteral = "neofetch" + args: str | None = None distro: str | None = None pride_month_shown: list[int] = field(default_factory=list) # This is deprecated, see issue #136 pride_month_disable: bool = False