commit 0ad254c
hovercats
·
2026-08-18 02:35:09 +0000 UTC
parent 3bb7d11
put nc command into a function aswell
1 files changed,
+5,
-4
M
ampv
M
ampv
+5,
-4
1@@ -4,16 +4,17 @@ musicdir=$HOME/usr/Music
2 socket=/tmp/.mpvsocket
3
4 fn player {mpv '--input-ipc-server='$socket $*}
5+fn njetcat {nc -UN $socket}
6
7 switch($1) {
8 case next
9- printf 'playlist-next\n' | nc -UN $socket
10+ printf 'playlist-next\n' | njetcat
11 case pause
12- printf 'cycle pause\n' | nc -UN $socket
13+ printf 'cycle pause\n' | njetcat
14 case prev
15- printf 'playlist-prev\n' | nc -UN $socket
16+ printf 'playlist-prev\n' | njetcat
17 case shuffle
18- printf 'playlist-shuffle\n' | nc -UN $socket
19+ printf 'playlist-shuffle\n' | njetcat
20 case start
21 player --idle &
22 case play