From a917a9a693939ca47bac6b4cb52c49bf2b4d4aef Mon Sep 17 00:00:00 2001 From: "Azalea (on HyDEV-Daisy)" Date: Sat, 30 Jul 2022 13:27:26 -0400 Subject: [PATCH] [-] Remove no-color option --- hyfetch/main.py | 11 ++--------- hyfetch/neofetch_util.py | 11 ++++++++--- neofetch | 13 ------------- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/hyfetch/main.py b/hyfetch/main.py index f2b29225..9578282c 100755 --- a/hyfetch/main.py +++ b/hyfetch/main.py @@ -8,13 +8,10 @@ import re from itertools import permutations from typing import Iterable -from hyfetch import presets - -from .color_util import printc, color, clear_screen, LightDark +from .color_util import printc, color, clear_screen from .constants import CONFIG_PATH, VERSION, TERM_LEN, TEST_ASCII_WIDTH, TEST_ASCII, GLOBAL_CFG from .models import Config -from .neofetch_util import run_neofetch, get_distro_ascii, ColorAlignment, ascii_size, fore_back, \ - get_fore_back +from .neofetch_util import run_neofetch, get_distro_ascii, ColorAlignment, ascii_size, get_fore_back from .presets import PRESETS @@ -279,7 +276,6 @@ def run(): parser.add_argument('--debug', action='store_true', help=f'Debug mode') parser.add_argument('--test-distro', help=f'Test for a specific distro') parser.add_argument('--test-print', action='store_true', help=f'Test print distro ascii art only') - parser.add_argument('--no-color', action='store_true', help=f'Use original neofetch without colors') args = parser.parse_args() @@ -327,8 +323,5 @@ def run(): if config.lightness: preset = preset.set_light_dl(config.lightness) - if args.no_color: - preset = None - # Run run_neofetch(preset, config.color_align) diff --git a/hyfetch/neofetch_util.py b/hyfetch/neofetch_util.py index 94f0f24b..bfc6be0a 100644 --- a/hyfetch/neofetch_util.py +++ b/hyfetch/neofetch_util.py @@ -154,11 +154,16 @@ def get_distro_name(): return check_output([get_command_path(), 'ascii_distro_name']).decode().strip() -def run_neofetch(preset: ColorProfile | None, alignment: ColorAlignment): +def run_neofetch(preset: ColorProfile, alignment: ColorAlignment): + """ + Run neofetch with colors + + :param preset: Color palette + :param alignment: Color alignment settings + """ asc = get_distro_ascii() w, h = ascii_size(asc) - if preset is not None: - asc = alignment.recolor_ascii(asc, preset) + asc = alignment.recolor_ascii(asc, preset) # Write temp file with TemporaryDirectory() as tmp_dir: diff --git a/neofetch b/neofetch index 528f4982..99187d65 100755 --- a/neofetch +++ b/neofetch @@ -11646,17 +11646,4 @@ get_print_custom_ascii() { echo "$ascii_data" } -get_test_distro_ascii() { - # Load default config. - eval "$config" - - distro="$CUSTOM_DISTRO" - ascii_distro=$distro - get_bold - get_distro_ascii - - image_backend - dynamic_prompt -} - main "$@"