From a2d25cba38aee3c5023bcfedf3cc8cc4a1c008a9 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sat, 3 Jun 2023 22:54:03 +0200 Subject: update mpv and jellyfin-mpv-shim config --- .config/mpv/scripts/copy-subs.lua | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .config/mpv/scripts/copy-subs.lua (limited to '.config/mpv/scripts/copy-subs.lua') diff --git a/.config/mpv/scripts/copy-subs.lua b/.config/mpv/scripts/copy-subs.lua new file mode 100644 index 0000000..ae0aded --- /dev/null +++ b/.config/mpv/scripts/copy-subs.lua @@ -0,0 +1,9 @@ +function copy_sub() + sub = mp.get_property("sub-text", "string") + if sub and sub ~= '' then + os.execute("echo '" .. sub:gsub('\'', '\'\\\'\'') .. "' | xclip -selection clipboard -i") + end +end + +mp.add_key_binding(nil, "copy", copy_sub) + -- cgit v1.2.3