[+] 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,13 +379,14 @@ def run():
if now.month == 6 and now.year not in config.pride_month_shown and os.isatty(sys.stdout.fileno()): if now.month == 6 and now.year not in config.pride_month_shown and os.isatty(sys.stdout.fileno()):
args.june = True args.june = True
if args.june: if args.june and not config.pride_month_disable:
pride_month.start_animation() pride_month.start_animation()
print() print()
print("Happy pride month!") print("Happy pride month!")
print("(You can always view the animation again with `hyfetch --june`)") print("(You can always view the animation again with `hyfetch --june`)")
print() print()
config.pride_month_shown.append(now.year) if now.year not in config.pride_month_shown:
config.pride_month_shown.append(now.year)
config.save() config.save()
# Use a custom distro # Use a custom distro

View file

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