diff --git a/README.md b/README.md index 8058341..73c17a5 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,8 @@ download the patch file to the base directory of mpvacious, which may be ```~/.c and run the following command: ``` shell $ patch -p1 < use_xsel.patch -``` \ No newline at end of file +``` + +- **force-japanese** is pretty straightforward, it forces mpv to play in japanese.

+ This is useful when encoders tend to give english priority, instead of the original language, and when mpv.conf doesn't work properly.

+ In my experience tweaking the mpv dotfiles weren't enough to make sure that japanese was the default language to play media in mpv. diff --git a/README.md~ b/README.md~ new file mode 100644 index 0000000..8058341 --- /dev/null +++ b/README.md~ @@ -0,0 +1,14 @@ +Patch list: + +- **use_xsel** is a patch that reduces the latency of clipboard transactions, making it smoother while properly managing the memory.
+ xsel has been around since 2001, and it's stable and has less dependencies than xclip, not to mention the compelling group of devs. + +[xclip flaws](https://web.archive.org/web/20240712181840/https://zwyx.dev/til/2023/01/12/xclip%20and%20xsel) + +how to use: + +download the patch file to the base directory of mpvacious, which may be ```~/.config/mpv/scripts/sub2srs/```
+and run the following command: +``` shell +$ patch -p1 < use_xsel.patch +``` \ No newline at end of file diff --git a/force-japanese.patch b/force-japanese.patch new file mode 100644 index 0000000..3cf0b49 --- /dev/null +++ b/force-japanese.patch @@ -0,0 +1,93 @@ +Binary files mpvacious/.git/index and mpvacious-patched/.git/index differ +diff -ruN mpvacious/.git/logs/HEAD mpvacious-patched/.git/logs/HEAD +--- mpvacious/.git/logs/HEAD 2024-07-22 15:31:00.086132886 -0400 ++++ mpvacious-patched/.git/logs/HEAD 2024-07-22 15:30:14.821186211 -0400 +@@ -1 +1 @@ +-0000000000000000000000000000000000000000 aa86597d5e65c9c40b12841a945be7a3cd0fb7b3 hashirama 1721676660 -0400 clone: from https://github.com/Ajatt-Tools/mpvacious.git ++0000000000000000000000000000000000000000 aa86597d5e65c9c40b12841a945be7a3cd0fb7b3 hashirama 1721676614 -0400 clone: from https://github.com/Ajatt-Tools/mpvacious.git +diff -ruN mpvacious/.git/logs/refs/heads/master mpvacious-patched/.git/logs/refs/heads/master +--- mpvacious/.git/logs/refs/heads/master 2024-07-22 15:31:00.086132886 -0400 ++++ mpvacious-patched/.git/logs/refs/heads/master 2024-07-22 15:30:14.821186211 -0400 +@@ -1 +1 @@ +-0000000000000000000000000000000000000000 aa86597d5e65c9c40b12841a945be7a3cd0fb7b3 hashirama 1721676660 -0400 clone: from https://github.com/Ajatt-Tools/mpvacious.git ++0000000000000000000000000000000000000000 aa86597d5e65c9c40b12841a945be7a3cd0fb7b3 hashirama 1721676614 -0400 clone: from https://github.com/Ajatt-Tools/mpvacious.git +diff -ruN mpvacious/.git/logs/refs/remotes/origin/HEAD mpvacious-patched/.git/logs/refs/remotes/origin/HEAD +--- mpvacious/.git/logs/refs/remotes/origin/HEAD 2024-07-22 15:31:00.086132886 -0400 ++++ mpvacious-patched/.git/logs/refs/remotes/origin/HEAD 2024-07-22 15:30:14.821186211 -0400 +@@ -1 +1 @@ +-0000000000000000000000000000000000000000 aa86597d5e65c9c40b12841a945be7a3cd0fb7b3 hashirama 1721676660 -0400 clone: from https://github.com/Ajatt-Tools/mpvacious.git ++0000000000000000000000000000000000000000 aa86597d5e65c9c40b12841a945be7a3cd0fb7b3 hashirama 1721676614 -0400 clone: from https://github.com/Ajatt-Tools/mpvacious.git +Binary files mpvacious/.git/objects/pack/pack-020c392851862423cb8bce6808896d817fd39b29.idx and mpvacious-patched/.git/objects/pack/pack-020c392851862423cb8bce6808896d817fd39b29.idx differ +Binary files mpvacious/.git/objects/pack/pack-020c392851862423cb8bce6808896d817fd39b29.pack and mpvacious-patched/.git/objects/pack/pack-020c392851862423cb8bce6808896d817fd39b29.pack differ +Binary files mpvacious/.git/objects/pack/pack-020c392851862423cb8bce6808896d817fd39b29.rev and mpvacious-patched/.git/objects/pack/pack-020c392851862423cb8bce6808896d817fd39b29.rev differ +Binary files mpvacious/.git/objects/pack/pack-7da0665222863ab22efcaeebb25779cd86662677.idx and mpvacious-patched/.git/objects/pack/pack-7da0665222863ab22efcaeebb25779cd86662677.idx differ +Binary files mpvacious/.git/objects/pack/pack-7da0665222863ab22efcaeebb25779cd86662677.pack and mpvacious-patched/.git/objects/pack/pack-7da0665222863ab22efcaeebb25779cd86662677.pack differ +Binary files mpvacious/.git/objects/pack/pack-7da0665222863ab22efcaeebb25779cd86662677.rev and mpvacious-patched/.git/objects/pack/pack-7da0665222863ab22efcaeebb25779cd86662677.rev differ +diff -ruN mpvacious/utils/force-japanese.lua mpvacious-patched/utils/force-japanese.lua +--- mpvacious/utils/force-japanese.lua 1969-12-31 20:00:00.000000000 -0400 ++++ mpvacious-patched/utils/force-japanese.lua 2024-07-22 15:31:41.919310736 -0400 +@@ -0,0 +1,64 @@ ++local assdraw = require 'mp.assdraw' ++ ++local preferred_alangs = {"jpn", "ja", "japanese"} ++local preferred_slangs = {"jpn", "ja", "japanese"} ++ ++local phrases = { ++ "日本語オンリーで行こう!英語なんて大嫌い!", ++ "これで完全に日本語モードです!", ++ "やったね!日本語が優先されました!", ++ "日本語が一番!英語は嫌いだ!", ++ "今、完全に日本語です!英語はなし!" ++} ++ ++function select_tracks() ++ local tracks = mp.get_property_native("track-list") ++ local selected_aid = nil ++ local selected_sid = nil ++ ++ for _, lang in ipairs(preferred_alangs) do ++ for _, track in ipairs(tracks) do ++ if track.type == "audio" and track.lang == lang then ++ selected_aid = track.id ++ break ++ end ++ end ++ if selected_aid then break end ++ end ++ ++ for _, lang in ipairs(preferred_slangs) do ++ for _, track in ipairs(tracks) do ++ if track.type == "sub" and track.lang == lang then ++ selected_sid = track.id ++ break ++ end ++ end ++ if selected_sid then break end ++ end ++ ++ if selected_aid then ++ mp.set_property("aid", selected_aid) ++ mp.add_timeout(3, show_phrase) ++ end ++ ++ if selected_sid then ++ mp.set_property("sid", selected_sid) ++ mp.add_timeout(3, show_phrase) ++ end ++end ++ ++function show_phrase() ++ local phrase = phrases[math.random(#phrases)] ++ local ass = assdraw.ass_new() ++ ass:append("{\\an9\\fs20\\bord1\\shad0\\c&HFFFFFF&\\3c&H000000&}") ++ ass:append(phrase) ++ mp.set_osd_ass(0, 0, ass.text) ++ mp.add_timeout(2, function() mp.set_osd_ass(0, 0, "") end) ++end ++ ++mp.register_event("file-loaded", select_tracks) ++ ++-- Ensure the phrase shows up when MPV is not in idle mode ++if not mp.get_property_native("idle") then ++ select_tracks() ++end