-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use XDG_DATA_HOME and XDG_CACHE_HOME if defined for UID and DB #17
base: master
Are you sure you want to change the base?
Conversation
Falling back to standard locations then the script's shared directory otherwise.
scripts_dir = mp.find_config_file("scripts") | ||
local scripts_dir = mp.find_config_file("scripts") | ||
local home_dir = os.getenv("HOME") | ||
local data_dir = os.getenv("XDG_DATA_HOME") or home_dir and utils.join_path(home_dir, ".local/share") or scripts_dir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't make it fallback to home, maybe we can do something like this instead https://github.com/hishamhm/datafile/blob/master/datafile/openers/unix.lua
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I'm misreading, this never falls back to ~
and the preference order is:
${XDG_DATA_HOME}
${HOME}/.local/share
scripts_dir
this is also missing windows support... is that required @po5? look at the repo i linked they have https://github.com/hishamhm/datafile/blob/master/datafile/openers/windows.lua not sure if |
I didn't merge this PR since it's obvious it'll break on tons of systems. |
agreed, but I don't think putting state into mpv's script directory is great either 😛 i don't think mpv exposes it's state/cache directories via the plugin api, so if we want to improve on the current situation the xdg paths (and their equivalent on other platforms) seem like a sane choice? |
mpv's options support shortcuts for various paths. Maybe the directory could be an option for mpv_sponsorblock that defaults to |
I'm not sure why this dir is named "shared". No other users, scripts, or programs will be using this dir right? The only real requirement is that it be writable.
On Windows, standard for user-specific app configs is If you wanted to do everything "by-the-book", I would say I would say the best location for both files on Windows is simply the script directory, |
… Falling back to standard locations then the script's shared directory otherwise.
GitHub: closes #16