config: replace config dir lua-settings/ with dir script-opts/

lua-settings/ is still supported, with deprecation warning.
This commit is contained in:
Avi Halachmi (:avih) 2017-12-13 19:37:42 +02:00 committed by Kevin Mitchell
parent b0951d71f8
commit 9eadc068fa
No known key found for this signature in database
GPG Key ID: 559A34B46A917232
6 changed files with 14 additions and 5 deletions

View File

@ -85,6 +85,7 @@ Interface changes
(such as "sub-file"), deprecated in mpv 0.26.0
- deprecate the old command based hook API, and introduce a proper C API
(the high level Lua API for this does not change)
- rename the the lua-settings/ config directory to script-opts/
--- mpv 0.28.0 ---
- rename --hwdec=mediacodec option to mediacodec-copy, to reflect
conventions followed by other hardware video decoding APIs

View File

@ -531,7 +531,7 @@ Example implementation::
print(options.optionA)
The config file will be stored in ``lua-settings/identifier.conf`` in mpv's user
The config file will be stored in ``script-opts/identifier.conf`` in mpv's user
folder. Comment lines can be started with # and stray spaces are not removed.
Boolean values will be represented with yes/no.

View File

@ -1172,7 +1172,7 @@ For Windows-specifics, see `FILES ON WINDOWS`_ section.
``--write-filename-in-watch-later-config`` option, and the player will
add the media filename to the contents of the resume config file.
``~/.config/mpv/lua-settings/osc.conf``
``~/.config/mpv/script-opts/osc.conf``
This is loaded by the OSC script. See the `ON SCREEN CONTROLLER`_ docs
for details.

View File

@ -128,7 +128,7 @@ Configuration
-------------
The OSC offers limited configuration through a config file
``lua-settings/osc.conf`` placed in mpv's user dir and through the
``script-opts/osc.conf`` placed in mpv's user dir and through the
``--script-opts`` command-line option. Options provided through the command-line
will override those from the config file.

View File

@ -35,7 +35,7 @@ monospaced digits is recommended. By default, the open source font
Configuration
-------------
This script can be customized through a config file ``lua-settings/stats.conf``
This script can be customized through a config file ``script-opts/stats.conf``
placed in mpv's user directory and through the ``--script-opts`` command-line
option. The configuration syntax is described in `ON SCREEN CONTROLLER`_.

View File

@ -37,8 +37,16 @@ local function read_options(options, identifier)
msg.debug("reading options for " .. identifier)
-- read config file
local conffilename = "lua-settings/" .. identifier .. ".conf"
local conffilename = "script-opts/" .. identifier .. ".conf"
local conffile = mp.find_config_file(conffilename)
if conffile == nil then
msg.verbose(conffilename .. " not found.")
conffilename = "lua-settings/" .. identifier .. ".conf"
conffile = mp.find_config_file(conffilename)
if conffile then
msg.warn("lua-settings/ is deprecated, use directory script-opts/")
end
end
local f = conffile and io.open(conffile,"r")
if f == nil then
-- config not found