[+] Add custom ascii file option, closes #104

This commit is contained in:
Azalea Gui 2023-03-20 23:31:14 -04:00
parent 365ed5a91f
commit 8c5905c858
No known key found for this signature in database
GPG key ID: E289FAC0DA92DD2B
2 changed files with 13 additions and 17 deletions

View file

@ -320,7 +320,9 @@ def run():
parser.add_argument('--c-set-l', dest='light', help=f'Set lightness value of the colors', type=float)
parser.add_argument('-V', '--version', dest='version', action='store_true', help=f'Check version')
parser.add_argument('--debug', action='store_true', help=f'Debug mode')
parser.add_argument('--distro', '--test-distro', dest='distro', help=f'Test for a specific distro')
parser.add_argument('--ascii-file', help='Use a specific file for the ascii art')
# Hidden debug arguments
# --test-print: Print the ascii distro and exit
@ -384,7 +386,9 @@ def run():
# Run
try:
neofetch_util.run(preset, config.color_align, config.backend)
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)
except Exception as e:
print(f'Error: {e}')
traceback.print_exc()