Skip to content

misc.lua: add this script #16129

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

guidocella
Copy link
Contributor

Add a script with script bindings to edit mpv.conf and input.conf, and add them to the menu. These are useful as shortcuts, but the main motivation is that new users often ask why they can't find mpv.conf and input.conf, so this creates them if they don't exist, also including links to the documentation.

Other future script bindings that don't fit anywhere else can also be added to utils.lua.

Copy link

github-actions bot commented Mar 26, 2025

@guidocella guidocella force-pushed the utils branch 3 times, most recently from b465f69 to 3629e3c Compare March 28, 2025 06:46
@@ -556,6 +556,7 @@ static const m_option_t mp_opts[] = {
{"load-select", OPT_BOOL(lua_load_select), .flags = UPDATE_BUILTIN_SCRIPTS},
{"load-positioning", OPT_BOOL(lua_load_positioning), .flags = UPDATE_BUILTIN_SCRIPTS},
{"load-commands", OPT_BOOL(lua_load_commands), .flags = UPDATE_BUILTIN_SCRIPTS},
{"load-utils", OPT_BOOL(lua_load_utils), .flags = UPDATE_BUILTIN_SCRIPTS},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we convert this to load option to string list? Not related to this PR, just an idea I got rn.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong preference either way

return
end

file_handle:write(initial_contents .. "\n")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need \n here, initial content seems to already have new line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's not needed after I added newlines in the initial contents

@kasper93
Copy link
Member

misc.lua, instead of utils.lua? It's more like miscellaneous functions than utils to be used by other scripts.

@hooke007
Copy link
Contributor

This might be a name to be easily misunderstood. I thought it was related to the mp.utils functions before checking.

Add a script with script bindings to edit mpv.conf and input.conf, and
add them to the menu. These are useful as shortcuts, but the main
motivation is that new users often ask why they can't find mpv.conf and
input.conf, so this creates them if they don't exist, also including
links to the documentation.

Other future script bindings that don't fit anywhere else can also be
added to misc.lua.
@guidocella guidocella changed the title utils.lua: add this script misc.lua: add this script Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants