diff options
l--------- | .config/jellyfin-mpv-shim/input.conf | 1 | ||||
-rw-r--r-- | .config/jellyfin-mpv-shim/mpv.conf##template | 4 | ||||
l--------- | .config/jellyfin-mpv-shim/scripts/copy-subs.lua | 1 | ||||
-rw-r--r-- | .config/mpv/input.conf | 1 | ||||
-rw-r--r-- | .config/mpv/mpv.conf | 1 | ||||
-rw-r--r-- | .config/mpv/scripts/copy-subs.lua | 9 |
6 files changed, 16 insertions, 1 deletions
diff --git a/.config/jellyfin-mpv-shim/input.conf b/.config/jellyfin-mpv-shim/input.conf new file mode 120000 index 0000000..b614064 --- /dev/null +++ b/.config/jellyfin-mpv-shim/input.conf @@ -0,0 +1 @@ +../mpv/input.conf
\ No newline at end of file diff --git a/.config/jellyfin-mpv-shim/mpv.conf##template b/.config/jellyfin-mpv-shim/mpv.conf##template new file mode 100644 index 0000000..51ac6aa --- /dev/null +++ b/.config/jellyfin-mpv-shim/mpv.conf##template @@ -0,0 +1,4 @@ +{% include "../mpv/mpv.conf" %} + +# better japanese font for watching with japanese subtitles +sub-font 'Hiragino Kaku Gothic ProN' diff --git a/.config/jellyfin-mpv-shim/scripts/copy-subs.lua b/.config/jellyfin-mpv-shim/scripts/copy-subs.lua new file mode 120000 index 0000000..32536ff --- /dev/null +++ b/.config/jellyfin-mpv-shim/scripts/copy-subs.lua @@ -0,0 +1 @@ +../../mpv/scripts/copy-subs.lua
\ No newline at end of file diff --git a/.config/mpv/input.conf b/.config/mpv/input.conf index df7953c..825bfd5 100644 --- a/.config/mpv/input.conf +++ b/.config/mpv/input.conf @@ -1,3 +1,4 @@ ALT+j add sub-scale +0.1 ALT+k add sub-scale -0.1 +ALT+c script-message-to copy_subs copy diff --git a/.config/mpv/mpv.conf b/.config/mpv/mpv.conf index 53786d5..50d629c 100644 --- a/.config/mpv/mpv.conf +++ b/.config/mpv/mpv.conf @@ -3,4 +3,3 @@ fs=yes # Display English subtitles if available. slang=en - 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) + |