Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonniek/mpv-menu
A simple 0-dependency mpv menu to launch commands from
https://github.com/jonniek/mpv-menu
lua mpv mpv-script
Last synced: 3 months ago
JSON representation
A simple 0-dependency mpv menu to launch commands from
- Host: GitHub
- URL: https://github.com/jonniek/mpv-menu
- Owner: jonniek
- Created: 2020-05-07T14:18:37.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-05-09T16:41:25.000Z (over 4 years ago)
- Last Synced: 2024-06-30T09:16:57.668Z (5 months ago)
- Topics: lua, mpv, mpv-script
- Language: Lua
- Homepage:
- Size: 1.95 KB
- Stars: 44
- Watchers: 1
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-mpv - menu - Configurable on screen menu to run custom commands. (Menu)
README
# mpv-menu
Simple mpv menu to launch commands from.This script allows you to make your own list of commands that you would like to have quick access to without
the need to remember the specific keybind.### Setup
Put the `menu.lua` file to your `mpv/scripts/` directory. To enable the script you need a `menu.json` file in
your `mpv/script-opts/` directory.Example of the structure of the json
```json
[
{
"label": "Simply quit mpv",
"command": ["quit"]
},
{
"label": "Set music profile by running two commands",
"command": [["apply-profile", "music-disable"], ["show-text", "Music!"]],
},
{
"label": "Increase brightness without closing menu",
"command": ["add", "brightness", "1"],
"keep_open": true
}
]
```To run arbitrary lua code you need to create a custom script that listens to script-messages.
**mpv/scripts/my_custom_command.lua**
```lua
function my_custom_command(some_data, some_flag)
-- do something cool
endmp.register_script_message("my_custom_command", my_custom_command)
```You can then add it to the menu with the following
```json
[
{
"title": "My custom command",
"command": ["script-message", "my_custom_command", "some_data", true]
}
]
```