master hovercats/bin / sh / smpv
 1#!/bin/sh
 2
 3# todo
 4# [ ] add currently playing to a playlist
 5# [ ] add to queue
 6# [ ] 'play next' functionality
 7# [ ] manipulate playlist
 8# 	- loadfile in manpage here is relevant
 9# [x] specify playlist
10# - pass under $@
11# [ ] add to current playlist
12# [ ] show current song
13# [x] shuffle
14# 	- just pass this under $@
15# [ ] start in idle?
16# 	- do we need --idle?
17
18socketpath=/tmp/.mpvsocket
19
20case $1 in
21	play)
22		mpv --no-audio-display --input-ipc-server="$socketpath" "$@"
23		;;
24	pause)
25		echo "cycle pause" | nc -UN  "$socketpath"
26		;;
27	next)
28		echo "playlist-next" | nc -UN "$socketpath"
29		;;
30	prev)
31		echo "playlist-prev" | nc -UN "$socketpath"
32		;;
33	*)
34		echo "Error"
35		exit 1
36		;;
37esac