summary refs log tree commit diff
path: root/.config/mpv/scripts/yanky.lua
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2026-02-10 12:32:48 +0100
committerRobert Günzler <r@gnzler.io>2026-02-10 12:41:25 +0100
commit63feeb9f369fc6176e85c1c2d8fcc863caad1946 (patch)
tree41cd5d2d1ec36e74e464caab722cc9b460153f04 /.config/mpv/scripts/yanky.lua
parent5bd0a4aca65ecb9818ef1285982d160b6b6ff665 (diff)
start new
Signed-off-by: Robert Günzler <r@gnzler.io>
Diffstat (limited to '.config/mpv/scripts/yanky.lua')
-rw-r--r--.config/mpv/scripts/yanky.lua37
1 files changed, 0 insertions, 37 deletions
diff --git a/.config/mpv/scripts/yanky.lua b/.config/mpv/scripts/yanky.lua
deleted file mode 100644
index be9d308..0000000
--- a/.config/mpv/scripts/yanky.lua
+++ /dev/null
@@ -1,37 +0,0 @@
-local mp = require("mp")
-
-function yank(payload)
-	mp.commandv("run", "wl-copy", payload)
-	mp.msg.info("yanked: " .. payload)
-	mp.osd_message("yanked: " .. payload)
-end
-
-function yankproperty(prop)
-	yank(mp.get_property_native(prop))
-end
-
-function yankpath()
-	local path = mp.get_property_native("path")
-	if path ~= "^http" then
-		yank(path)
-		return
-	end
-	local cwd = mp.get_property_native("working-directory")
-	yank(require("mp.utils").join_path(cwd, path))
-end
-
-function yanktime()
-	local s = mp.get_property_native("playback-time")
-	local ts = string.format("%.2d:%.2d:%.2d.%.3d", s / (60 * 60), s / 60 % 60, s % 60, (s % 1) * 1000)
-	yank(ts)
-end
-
-function yanksubs()
-	local subText = mp.get_property("sub-text")
-	-- local secondarySubText = mp.get_property("secondary-sub-text")
-	yank(subText)
-end
-
-mp.add_key_binding("y-t", "yanktime", yanktime)
-mp.add_key_binding("y-p", "yankpath", yankpath)
-mp.add_key_binding("y-s", "yanksubs", yanksubs)