Skip to content
Shuanglei Tao edited this page Jan 20, 2024 · 12 revisions

Tip

  • Want a usable full config example? Check this gist.
  • You may define custom keywords and update menu with message.

input.conf

The menu syntax is similar to mpv.net, with some enhancements:

  • define menu title after #menu:
    • define separator with -
    • split title with > to define submenus
    • use #@keyword to display selection menu for:
      • #@tracks: track list (video/audio/subtitle)
        • #@tracks/video: video track list
        • #@tracks/audio: audio track list
        • #@tracks/sub: subtitle list
        • #@tracks/sub-secondary: subtitle list (secondary)
      • #@chapters: chapter list
      • #@editions: edition list
      • #@audio-devices: audio device list
      • #@playlist: playlist
      • #@profiles: profile list
    • use #@prop:check to check menu item if property type and value is:
      • boolean: true
      • string: not empty
      • number: not zero
      • table: not empty
      • none of above: not nil
    • #@prop:check! is the reverse form of #@prop:check
  • use _ if no keybinding
  • use ignore if no command
Ctrl+a  show-text foobar    #menu: Foo > Bar
_       ignore              #menu: -
_       ignore              #menu: Tracks #@tracks
_       ignore              #menu: Chapters #@chapters
_       ignore              #menu: Editions #@editions
_       ignore              #menu: -
_       cycle mute          #menu: Audio > Mute #@mute:check
_       ignore              #menu: Audio > Devices #@audio-devices

Add a keybinding to trigger the menu (required):

MBTN_RIGHT script-message-to menu show

Note

  • If you changed the dll name, script-message-to target and conf file name should apply too.
  • If the menu doesn't always show on mouse click, Rename other scripts that used the menu name.

If both menu.dll and menu.lua exists in scripts folder, one of it may be named with menu2 by mpv, script-message-to menu show will break when it happens on menu.dll.

~~/script-opts/menu.conf

  • load=no: Disable menu load on startup.
  • uosc=yes: Enable uosc menu syntax support.

~~/script-opts/dyn_menu.conf

  • max_title_length=80: Limits the title length in dynamic submenu, set to 0 to disable.
  • max_playlist_items=20: Limit the playlist items in submenu, set to 0 to disable.
Clone this wiki locally