From cb250d490c14872f03bb0320179e48d05fe2539d Mon Sep 17 00:00:00 2001 From: Kenneth Zhou Date: Wed, 18 Jun 2014 19:55:40 -0400 Subject: Basic xdg directory implementation Search $XDG_CONFIG_HOME and $XDG_CONFIG_DIRS for config files. This also negates the need to have separate user and global variants of mp_find_config_file() Closes #864, #109. Signed-off-by: wm4 --- player/scripting.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'player/scripting.c') diff --git a/player/scripting.c b/player/scripting.c index 7b3d408030..2272f3c2ee 100644 --- a/player/scripting.c +++ b/player/scripting.c @@ -167,11 +167,11 @@ void mp_load_scripts(struct MPContext *mpctx) } if (!mpctx->opts->auto_load_scripts) return; - // Load ~/.mpv/lua/* + + // Load all lua scripts void *tmp = talloc_new(NULL); - char *script_path = mp_find_user_config_file(tmp, mpctx->global, "lua"); - if (script_path) { - files = list_script_files(tmp, script_path); + for (char **luadir = mp_find_all_config_files(tmp, mpctx->global, "lua"); *luadir; luadir++) { + files = list_script_files(tmp, *luadir); for (int n = 0; files && files[n]; n++) mp_load_script(mpctx, files[n]); } -- cgit v1.2.3