summary refs log tree commit diff
path: root/dot_config/mpv/scripts/audio-osc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'dot_config/mpv/scripts/audio-osc.lua')
-rw-r--r--dot_config/mpv/scripts/audio-osc.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/dot_config/mpv/scripts/audio-osc.lua b/dot_config/mpv/scripts/audio-osc.lua
new file mode 100644
index 0000000..ded629d
--- /dev/null
+++ b/dot_config/mpv/scripts/audio-osc.lua
@@ -0,0 +1,9 @@
+-- show osc all the time when file is an audio file.
+-- source: https://github.com/mpv-player/mpv/issues/3500#issuecomment-305646994
+
+mp.register_event("file-loaded", function()
+    local hasvid = mp.get_property_osd("video") ~= "no"
+    mp.commandv("script-message", "osc-visibility", (hasvid and "auto" or "always"), "no-osd")
+    -- remove the next line if you don't want to affect the osd-bar config
+    mp.commandv("set", "options/osd-bar", (hasvid and "yes" or "no"))
+end)
\ No newline at end of file