Hello World in lua for mpv
- Save the script below(e.g.
hello.lua
) in~/.config/mpv/scripts/
folder. Ifscripts
folder doesn't exist, create it. - Play a video with mpv.
- While the video is playing, press g key. It will print Hello World on your terminal
require 'os' require 'io' require 'string' function print_hello_world() print("Hello World") end -- Set key bindings. mp.add_key_binding("g", "print_hello_world", print_hello_world)
Here is a video showing the code above in action.