[+] Add option to disable pride month animation

Closes #134
This commit is contained in:
Azalea 2023-06-06 20:05:28 -07:00
parent df11c756dd
commit 506f345a9d
2 changed files with 5 additions and 3 deletions

View file

@ -379,12 +379,13 @@ def run():
if now.month == 6 and now.year not in config.pride_month_shown and os.isatty(sys.stdout.fileno()):
args.june = True
if args.june:
if args.june and not config.pride_month_disable:
pride_month.start_animation()
print()
print("Happy pride month!")
print("(You can always view the animation again with `hyfetch --june`)")
print()
if now.year not in config.pride_month_shown:
config.pride_month_shown.append(now.year)
config.save()

View file

@ -18,6 +18,7 @@ class Config:
backend: BackendLiteral = "neofetch"
distro: str | None = None
pride_month_shown: list[int] = field(default_factory=list)
pride_month_disable: bool = False
@classmethod
def from_dict(cls, d: dict):
@ -26,4 +27,4 @@ class Config:
def save(self):
CONFIG_PATH.parent.mkdir(exist_ok=True, parents=True)
CONFIG_PATH.write_text(json_stringify(self), 'utf-8')
CONFIG_PATH.write_text(json_stringify(self, indent=4), 'utf-8')