diff --git a/hyfetch/main.py b/hyfetch/main.py index c574852c..39588018 100755 --- a/hyfetch/main.py +++ b/hyfetch/main.py @@ -8,6 +8,7 @@ from typing import Literal, Iterable from hypy_utils import printc, json_stringify +from .neofetch_util import run_neofetch from .presets import PRESETS @@ -110,13 +111,19 @@ def create_config() -> Config: tmp = PRESETS['rainbow'].color_text('preset') preset = literal_input(f'Which {tmp} do you want to use?', PRESETS.keys(), 'rainbow') - # Save and return + # Create config c = Config(preset, color_system) - c.save() + + # Save config + save = literal_input(f'Save config?', ['y', 'n'], 'y') + if save == 'y': + c.save() + return c def run(): parser = argparse.ArgumentParser(description='neofetch with flags <3') + # TODO: Param overwrite config config = check_config() - # TODO: --setup command + run_neofetch(PRESETS.get(config.preset)) diff --git a/hyfetch/neofetch_util.py b/hyfetch/neofetch_util.py index 4cb36713..e6f598ea 100644 --- a/hyfetch/neofetch_util.py +++ b/hyfetch/neofetch_util.py @@ -27,7 +27,7 @@ def get_distro_ascii() -> str: return check_output([get_command_path(), "print_ascii"]).decode().strip() -def run(preset: ColorProfile): +def run_neofetch(preset: ColorProfile): # Get existing ascii asc = get_distro_ascii()