commit c257a73
hovercats
·
2026-04-22 19:23:58 +0000 UTC
parent 5b2f09a
smpv: initial implementation of using mpv as music player from cli
1 files changed,
+37,
-0
A
sh/smpv
A
sh/smpv
+37,
-0
1@@ -0,0 +1,37 @@
2+#!/bin/sh
3+
4+# todo
5+# [ ] add currently playing to a playlist
6+# [ ] add to queue
7+# [ ] 'play next' functionality
8+# [ ] manipulate playlist
9+# - loadfile in manpage here is relevant
10+# [x] specify playlist
11+# - pass under $@
12+# [ ] add to current playlist
13+# [ ] show current song
14+# [x] shuffle
15+# - just pass this under $@
16+# [ ] start in idle?
17+# - do we need --idle?
18+
19+socketpath=/tmp/.mpvsocket
20+
21+case $1 in
22+ play)
23+ mpv --no-audio-display --input-ipc-server="$socketpath" "$@"
24+ ;;
25+ pause)
26+ echo "cycle pause" | nc -UN "$socketpath"
27+ ;;
28+ next)
29+ echo "playlist-next" | nc -UN "$socketpath"
30+ ;;
31+ prev)
32+ echo "playlist-prev" | nc -UN "$socketpath"
33+ ;;
34+ *)
35+ echo "Error"
36+ exit 1
37+ ;;
38+esac