Skip to content

Commit

Permalink
docs: add more details to the MPV subtitle tip
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Nov 20, 2024
1 parent e82975c commit 6fb1916
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions docs/tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,11 @@ run = '''

Credits to [@aidanzhai for sharing it](https://t.me/yazi_rs/3325/15373) in Yazi's telegram group.

## Add subtitle to the running MPV {#mpv-subtitle}
## Unix: Add subtitle to the running MPV {#mpv-subtitle}

Add these lines to your `~/.config/yazi/yazi.toml`:

```toml
# ~/.config/yazi/yazi.toml
[[opener.add-sub]]
run = ''' echo sub-add "'$0'" | socat - /tmp/mpv.sock '''
desc = "Add sub to MPV"
Expand All @@ -245,13 +246,14 @@ name = "*.{ass,srt,ssa,sty,sup,vtt}"
use = [ "add-sub", "edit" ]
```

Make sure you've enabled and configured the ipc socket to `/tmp/mpv.sock`, that is, include:

```
input-ipc-server=/tmp/mpv.sock
```
To make it work, make sure you've:

in your `~/.config/mpv/mpv.conf`.
1. Installed `socat` and can be found in your `$PATH`
2. Enabled and configured the ipc socket to `/tmp/mpv.sock`, that is, include:
```
input-ipc-server=/tmp/mpv.sock
```
in your `~/.config/mpv/mpv.conf`. See [the documentation of `--input-ipc-server`](https://mpv.io/manual/stable/#options-input-ipc-server) for more info.

## Maximize preview pane {#max-preview}

Expand Down

0 comments on commit 6fb1916

Please sign in to comment.