[+] Add no-color argument
This commit is contained in:
parent
694725c56e
commit
66ad0f7297
2 changed files with 10 additions and 5 deletions
|
|
@ -276,9 +276,10 @@ def run():
|
||||||
parser.add_argument('--c-scale', dest='scale', help=f'Lighten colors by a multiplier', type=float)
|
parser.add_argument('--c-scale', dest='scale', help=f'Lighten colors by a multiplier', type=float)
|
||||||
parser.add_argument('--c-set-l', dest='light', help=f'Set lightness value of the colors', type=float)
|
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('-V', '--version', dest='version', action='store_true', help=f'Check version')
|
||||||
parser.add_argument('--debug', action='store_true', help=color(f'Debug mode'))
|
parser.add_argument('--debug', action='store_true', help=f'Debug mode')
|
||||||
parser.add_argument('--test-distro', help=color(f'Test for a specific distro'))
|
parser.add_argument('--test-distro', help=f'Test for a specific distro')
|
||||||
parser.add_argument('--test-print', action='store_true', help=color(f'Test print distro ascii art only'))
|
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()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
@ -326,5 +327,8 @@ def run():
|
||||||
if config.lightness:
|
if config.lightness:
|
||||||
preset = preset.set_light_dl(config.lightness)
|
preset = preset.set_light_dl(config.lightness)
|
||||||
|
|
||||||
|
if args.no_color:
|
||||||
|
preset = None
|
||||||
|
|
||||||
# Run
|
# Run
|
||||||
run_neofetch(preset, config.color_align)
|
run_neofetch(preset, config.color_align)
|
||||||
|
|
|
||||||
|
|
@ -154,10 +154,11 @@ def get_distro_name():
|
||||||
return check_output([get_command_path(), 'ascii_distro_name']).decode().strip()
|
return check_output([get_command_path(), 'ascii_distro_name']).decode().strip()
|
||||||
|
|
||||||
|
|
||||||
def run_neofetch(preset: ColorProfile, alignment: ColorAlignment):
|
def run_neofetch(preset: ColorProfile | None, alignment: ColorAlignment):
|
||||||
asc = get_distro_ascii()
|
asc = get_distro_ascii()
|
||||||
w, h = ascii_size(asc)
|
w, h = ascii_size(asc)
|
||||||
asc = alignment.recolor_ascii(asc, preset)
|
if preset is not None:
|
||||||
|
asc = alignment.recolor_ascii(asc, preset)
|
||||||
|
|
||||||
# Write temp file
|
# Write temp file
|
||||||
with TemporaryDirectory() as tmp_dir:
|
with TemporaryDirectory() as tmp_dir:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue