gdi3d / mute-spotify-ads-mac-osx

Mute Mac (osx) computer audio when Spotify plays an AD
https://gdi3d.github.io/mute-spotify-ads-mac-osx/
MIT License
120 stars 16 forks source link

Allow specifying stats.txt path #27

Closed Alberdi closed 2 years ago

Alberdi commented 2 years ago

It would be great if we could specify where the stats file will be located, instead of generating it in the current directory.

And thank you for the script!

gdi3d commented 2 years ago

Hey!, thanks for your kind words!.

Why is this important to you?, Do you wanna back it up or something like that?

Alberdi commented 2 years ago

Yes, how rude of me!

I have the NoAdsSpotify.sh script in a ~/bin directory that, along other utilities, is in my PATH. I launch it from the terminal when needed from the directory I'm at the moment and the stats.txt file is created there.

I if I could set an env variable to point it to a given place, or pass an argument for the same effect, I could ensure that it's always using the same file and that it doesn't pollute my current directory.

Alternatively, it could also use by default a common directory such as ~/.local/NoAdsSpotify or something that is widely used in Mac OS.

gdi3d commented 2 years ago

I understand your need.

I'll think about it. Maybe the env var is the best way to go.

I don't want this to affect non-tech user.

gdi3d commented 2 years ago

I decided to go with the env var option.

To use it you need to define the env var MUTE_SPOTIFY_STATS_PATH and use FULL PATH to define the place where you want to create/use the file.

I also updated the docs https://gdi3d.github.io/mute-spotify-ads-mac-osx/index.html#stats-file-advanced-users

Feel free to close the ticket if everything works.

And thanks for the suggestions ;)

Alberdi commented 2 years ago

Works like a charm! Thank you very much.