From b24463f3d045783b8f4e72926054d53b908e150f Mon Sep 17 00:00:00 2001 From: navewindre Date: Sat, 5 Apr 2025 02:59:37 +0200 Subject: a --- config/mpv/scripts/subs2srsa/howto/add_dialog.md | 9 +++++ config/mpv/scripts/subs2srsa/howto/create_card.md | 14 +++++++ .../scripts/subs2srsa/howto/create_quick_card.md | 31 +++++++++++++++ config/mpv/scripts/subs2srsa/howto/flatpak.md | 27 +++++++++++++ config/mpv/scripts/subs2srsa/howto/goldendict.md | 45 ++++++++++++++++++++++ config/mpv/scripts/subs2srsa/howto/yomichan.md | 24 ++++++++++++ 6 files changed, 150 insertions(+) create mode 100644 config/mpv/scripts/subs2srsa/howto/add_dialog.md create mode 100644 config/mpv/scripts/subs2srsa/howto/create_card.md create mode 100644 config/mpv/scripts/subs2srsa/howto/create_quick_card.md create mode 100644 config/mpv/scripts/subs2srsa/howto/flatpak.md create mode 100644 config/mpv/scripts/subs2srsa/howto/goldendict.md create mode 100644 config/mpv/scripts/subs2srsa/howto/yomichan.md (limited to 'config/mpv/scripts/subs2srsa/howto') diff --git a/config/mpv/scripts/subs2srsa/howto/add_dialog.md b/config/mpv/scripts/subs2srsa/howto/add_dialog.md new file mode 100644 index 0000000..22093c6 --- /dev/null +++ b/config/mpv/scripts/subs2srsa/howto/add_dialog.md @@ -0,0 +1,9 @@ +# Open the "Add" dialog + +1) Open a video in `mpv`. +1) Press a to open advanced menu. +1) Optionally, press c and select the desired subtitle lines with the interactive selection. +1) Press g to open the Add dialog in Anki. +1) Add dictionary definitions using software like GoldenDict, Qolibri, etc. + +After the card is created, you can find it by typing `added:1` in the Anki Browser. diff --git a/config/mpv/scripts/subs2srsa/howto/create_card.md b/config/mpv/scripts/subs2srsa/howto/create_card.md new file mode 100644 index 0000000..e92f77d --- /dev/null +++ b/config/mpv/scripts/subs2srsa/howto/create_card.md @@ -0,0 +1,14 @@ +# Make a simple sentence card + +To make a card from the currently visible subtitle line, press Ctrl+n. + +To make a card from two or more subtitle lines: + +1) Press a to open advanced menu. +2) Press c to start interactive selection. +3) Seek to the previous/next subtitle with Shift+h and Shift+l. +4) Press n to create a new card. + +After the card is created, you can find it by typing `added:1` in the Anki Browser. +The card doesn't contain dictionary definitions. +You need to add them yourself afterward, using software like GoldenDict, Qolibri, etc. diff --git a/config/mpv/scripts/subs2srsa/howto/create_quick_card.md b/config/mpv/scripts/subs2srsa/howto/create_quick_card.md new file mode 100644 index 0000000..619794a --- /dev/null +++ b/config/mpv/scripts/subs2srsa/howto/create_quick_card.md @@ -0,0 +1,31 @@ +# Quick Card Creation + +The goal of the quick card creation menu is to streamline a specific flow for media with **well-timed subtitles**: + +1) Add a new note to Anki via + [Rikaitan](https://tatsumoto.neocities.org/blog/setting-up-yomichan.html) + or any other tool that works with AnkiConnect. +2) Update the note via mpvacious. + +To update the most recently added card from the currently visible subtitle line, press gg. + +To make a card from two or more subtitle lines: + +1) Press g to open the quick card creation menu. +2) Press any number [2-9]. This number corresponds to the number of lines to create the card from. + +Note: g1 is also valid. +However, gg is an additional bind to further streamline the most common scenario. + +For example, +g2 creates a card using 2 subtitle lines. + +Like the advanced menu, you can also update multiple cards: + +1) Press Alt+g to select the number of cards for quick card creation. +2) Press any number [2-9]. This number corresponds to the number of cards to update. +3) Press any number [1-9] again. This is the number of lines. + +Note: upon completing the note update, the selected number of cards resets back to the default of one. + +For example, (Alt+g)22 would update the last 2 notes using 2 subtitle lines. diff --git a/config/mpv/scripts/subs2srsa/howto/flatpak.md b/config/mpv/scripts/subs2srsa/howto/flatpak.md new file mode 100644 index 0000000..46a5787 --- /dev/null +++ b/config/mpv/scripts/subs2srsa/howto/flatpak.md @@ -0,0 +1,27 @@ +# Flatpak notes + +We think it's best to never use Flatpak. +Specifically, try not to use Flatpak to install `mpv` and `anki`. +Install packages from the official repositories of your distro or from the AUR. + +Read the following notes if you still decide to use Flatpak. + +Make these changes in Flatseal: + +* Enable "Filesystem > All system files" + so it could see `wl-copy`. + Unfortunately, there's no option to provide only a specific system file. +* Add `~/.var/app/net.ankiweb.Anki` to "Filesystem > Other Files" + so mpvacious could add encoded snapshots and audio to Anki. +* Add `PATH=/home/USERNAME/.local/bin:/home/USERNAME/bin:/app/bin:/usr/bin:/run/host/usr/bin` to "Environment > Variables". + There's no option to add a path to `PATH` in Flatseal, + so I opened container, + saved it's PATH and added `/run/host/usr/bin` + so mpvacuous could access `wl-copy`. +* Enable "Shared > Network". + It's enabled by default, but anyway. + +The mpv config root is `~/.var/app/io.mpv.Mpv/config/mpv` + +* `~/.var/app/io.mpv.Mpv/config/mpv/scripts` +* `~/.var/app/io.mpv.Mpv/config/mpv/script-opts` diff --git a/config/mpv/scripts/subs2srsa/howto/goldendict.md b/config/mpv/scripts/subs2srsa/howto/goldendict.md new file mode 100644 index 0000000..7f355c6 --- /dev/null +++ b/config/mpv/scripts/subs2srsa/howto/goldendict.md @@ -0,0 +1,45 @@ +# Modifying cards added with GoldenDict + +You can add a card first using GoldenDict, +and then append an audio clip and a picture to it. + +**Note:** the only version of GoldenDict that can create Anki cards with configurable fields is +[xiaoyifang's goldendict](https://github.com/xiaoyifang/goldendict-ng). +Read [Setting up GoldenDict](https://tatsumoto-ren.github.io/blog/setting-up-goldendict.html) and +[How to connect with Anki](https://github.com/xiaoyifang/goldendict-ng/blob/staged/website/docs/topic_anki.md) +if you are new to GoldenDict. + +To send subtitles from `mpv` directly to GoldenDict, +append the following line to `subs2srs.conf`: + +``` +autoclip_method=goldendict +``` + +**Note:** If `goldendict` is not in the PATH, +you have to [add it to the PATH](https://wiki.archlinux.org/title/Environment_variables#Per_user). + +1) Press a to open `advanced menu`. +2) Press t to toggle the `autoclip` option. + +Now as subtitles appear on the screen, +they will be immediately sent to GoldenDict instead of the system clipboard. + +1) Open GoldenDict. +2) Play a video in `mpv`. +3) When you find an unknown word, + select the definition text, + right-click and select "send word to anki" to make a card, + or press Ctrl+Shift+N. +4) Go back to mpv and add an image and an audio clip + to the card you've just made by pressing m while the `advanced menu` is open. + Pressing Shift+m will overwrite any existing data in media fields. + +https://github.com/Ajatt-Tools/mpvacious/assets/69171671/0fc02d24-d320-4d2c-b7a9-cb478e9f0067 + +Don't forget to set the right timings and join lines together +if the sentence is split between multiple subs. +To do it, enter interactive selection by pressing c +and seek to the next or previous subtitle. + +To pair Mecab and GoldenDict, install [gd-tools](https://github.com/Ajatt-Tools/gd-tools). diff --git a/config/mpv/scripts/subs2srsa/howto/yomichan.md b/config/mpv/scripts/subs2srsa/howto/yomichan.md new file mode 100644 index 0000000..9ea16d6 --- /dev/null +++ b/config/mpv/scripts/subs2srsa/howto/yomichan.md @@ -0,0 +1,24 @@ +# Modifying cards added with Rikaitan + +You can add a card first using +[Rikaitan](https://tatsumoto.neocities.org/blog/setting-up-yomichan.html), +and then append an audio clip and a picture to it. + +1) Press a to open `advanced menu`. +1) Press t to toggle the `autoclip` option. + +Now as subtitles appear on the screen, they will be immediately copied to the clipboard. +You can use it in combination with clipboard monitor. + +1) Open [Rikaitan Search](https://tatsumoto.neocities.org/blog/what-is-yomichan-search) + by pressing Alt+Insert in your web browser. +1) Play a video in `mpv`. +1) When you find an unknown word, click the + button to make a card for it. +4) Go back to mpv and add an image and an audio clip + to the card you've just made by pressing m while the `advanced menu` is open. + Pressing Shift+m will overwrite any existing data in media fields. + +Don't forget to set the right timings and join lines together +if the sentence is split between multiple subs. +To do it, enter interactive selection by pressing c +and seek to the next or previous subtitle. -- cgit v1.2.3