hykilpikonna / hyfetch

🏳️‍🌈 🏳️‍⚧️ Neofetch with LGBTQ+ pride flags!
MIT License
1.27k stars 96 forks source link

Hyfetch assumes config is writeable when adding 'pride animation shown' flag #136

Closed Aleksanaa closed 1 year ago

Aleksanaa commented 1 year ago

Describe the bug

Hyfetch now displays an animation at the first start, and tries to add a flag to the config saying that it is shown.

https://github.com/hykilpikonna/hyfetch/blob/60b4b925d32ab105c680a832bbf88f4e30f88d33/hyfetch/main.py#L389

It may appear to be reasonable, but what if you are using home-manager? The config is just a symlink pointing to the read-only Nix store. If you tries to write to it, you'll fail, and if you choose to override it, home-manager will fail to deploy the next time.

Expected behavior

So just don't touch the config. If the config already exists, leave it there. And if we want to persist any state, just place it in xdg cache.

Additional context

Add any other context about the problem here.

hykilpikonna commented 1 year ago

Thanks for reporting the issue! It will create a file $XDG_CACHE_HOME/hyfetch/animation-displayed-{year} instead of writing the config from now on