mpv-player / mpv-examples

📚
235 stars 77 forks source link

Is there a simple way to load scripts from ~/.config/mpv/scripts ? #57

Open Anskrevy opened 1 year ago

Anskrevy commented 1 year ago

I'm getting a feel for the api with the simple example but my attempts at loading scripts have not worked. I've tried the following

    check_error(mpv_set_option_string(ctx, "config-dir", "/home/anon/.config/mpv"));
    check_error(mpv_set_option_string(ctx, "load-scripts", "yes"));

but to no avail. Will I really need to pass each script from the directory manually like so?

    for (int i = 0; i < argc; ++i)
        check_error(mpv_set_option_string(ctx, "script", argv[i]));

(assuming **argv is an array of script files)