Skip to content

Commit

Permalink
[+] Add random preset (Closes #334)
Browse files Browse the repository at this point in the history
  • Loading branch information
hykilpikonna committed Oct 23, 2024
1 parent d0f9119 commit 1211dc6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hyfetch/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def create_parser() -> argparse.ArgumentParser:

parser.add_argument('-c', '--config', action='store_true', help=color(f'Configure hyfetch'))
parser.add_argument('-C', '--config-file', dest='config_file', default=CONFIG_PATH, help=f'Use another config file')
parser.add_argument('-p', '--preset', help=f'Use preset', choices=list(PRESETS.keys()))
parser.add_argument('-p', '--preset', help=f'Use preset', choices=list(PRESETS.keys()) + ['random'])
parser.add_argument('-m', '--mode', help=f'Color mode', choices=['8bit', 'rgb'])
parser.add_argument('-b', '--backend', help=f'Choose a *fetch backend', choices=['qwqfetch', 'neofetch', 'fastfetch', 'fastfetch-old'])
parser.add_argument('--args', help=f'Additional arguments pass-through to backend')
Expand Down Expand Up @@ -437,6 +437,10 @@ def run():
config.backend = args.backend
if args.args:
config.args = args.args

# Random preset
if config.preset == 'random':
config.preset = random.choice(list(PRESETS.keys()))

# Override global color mode
GLOBAL_CFG.color_mode = config.mode
Expand Down

0 comments on commit 1211dc6

Please sign in to comment.