summary refs log tree commit diff
path: root/dot_config/mpv/scripts/audio-osc.lua
diff options
context:
space:
mode:
authorAlen <alen@dotfiles.xyz>2025-01-19 19:06:44 +0400
committerAlen <alen@dotfiles.xyz>2025-01-19 19:06:44 +0400
commit94ad728f49ceb99ab9c75a8ac5edbfcd708066dd (patch)
tree038a430cbe4bf7223d661fb60a3408f0b56828f1 /dot_config/mpv/scripts/audio-osc.lua
parentf73915ba4fd151b6fc2e4a74b8c54cc7b6e23042 (diff)
Add mpv config
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