blob: d89676ee1d923215e788ed6e3f6dd0d01bd38e74 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# Simple mpv audio ipc server service to play your songs
The client is designed to be a cli wrapper of [mpv ipc
reference](https://mpv.io/manual/master/#json-ipc)
## Requirements
* mpv
* yt-dlp
* socat
* systemd system
## Installation
To enable the service run:
```
sudo install -Dm 644 mpv-audio-server.service /usr/lib/systemd/user
systemctl --user enable --now mpv-audio-server
```
Install the script ipc client with:
```
install -Dm 755 mpv-ipc-client.sh ~/.local/bin
```
or make your own script using [mpv json-ipc reference](https://mpv.io/manual/master/#json-ipc)
## Usage
```
Usage: mpv-ipc-client.sh [-h] [-s SOCKET] <cmd> [ARGS...]
Options:
-h, --help Show this message
-s, --socket=SOCKET Point to socket file [default: /tmp/mpv-audio-server-vech.socket]
```
Play a song, it is important enclose song query in quotation marks
```
mpv-ipc-client.sh loadfile "master of puppets"
```
Append a song, to the playlist
```
mpv-ipc-client.sh loadfile "master of puppets" append-play
```
toggle between pause or play
```
mpv-ipc-client.sh cycle pause
```
get playlist:
```
mpv-ipc-client.sh get_property playlist
```
## See Also
To checkout all properties and commands availables run `mpv --list-properties`
and `mpv --input-cmdlist` respectively
Find more info at [mpv json-ipc reference](https://mpv.io/manual/master/#json-ipc)
|