Skip to content

Instantly share code, notes, and snippets.

@rrooij
Last active May 17, 2021 02:49
Show Gist options
  • Save rrooij/59f57ff5f5a952e56bbb to your computer and use it in GitHub Desktop.
Save rrooij/59f57ff5f5a952e56bbb to your computer and use it in GitHub Desktop.
Script for cycling through messages in mpv

cycle_messages

Cycles through predefined messages and displays them on the OSD. This script can be useful for notifying actions you made with custom keybindings for your OS.

The predefined values should be changed by your own messages.

-- Change these values to your own messages
local msg_values = {"test1", "test2", "test3"}
local current_index = 1;
local function cycle_messages()
local last_index = #msg_values
mp.osd_message(msg_values[current_index])
if current_index == last_index then
current_index = 1
else
current_index = current_index + 1
end
end
mp.add_key_binding("c", "cycle_messages", cycle_messages)
Copy link

ghost commented Sep 29, 2019

Is it possible to cycle internal commands such as show-text "${filename/no-ext}" and show-progress?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment