You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, when installing as a system package on various distros, all the files go in /usr/share/ or /opt/. These directories aren't the correct location to place a config file in. It would ideally go in $XDG_CONFIG_HOME/yt-spammer-purge/config.json so that the program can read it no matter where it's run from.
It doesn't have to read only from this directory, there can be a prioritized list of directories that it will try to read from.
e.g.: Check if file exists in pwd first, then check $XDG_CONFIG_HOME, then look for a default in $XDG_CONFIG_DIRS
This can be extended to Windows too, which uses %APPDATA%\Roaming to store configs and such.
There is a python package called platformdirs that can make this easy to handle, but it isn't necessary.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Here is the freedesktop spec.
Basically, when installing as a system package on various distros, all the files go in
/usr/share/
or/opt/
. These directories aren't the correct location to place a config file in. It would ideally go in$XDG_CONFIG_HOME/yt-spammer-purge/config.json
so that the program can read it no matter where it's run from.It doesn't have to read only from this directory, there can be a prioritized list of directories that it will try to read from.
e.g.: Check if file exists in
pwd
first, then check$XDG_CONFIG_HOME
, then look for a default in$XDG_CONFIG_DIRS
This can be extended to Windows too, which uses
%APPDATA%\Roaming
to store configs and such.There is a python package called
platformdirs
that can make this easy to handle, but it isn't necessary.Beta Was this translation helpful? Give feedback.
All reactions