commit 31364d2
hovercats
·
2026-08-31 11:55:33 +0000 UTC
parent 02c3d29
add flag to append file to queue
1 files changed,
+4,
-0
M
ampv
M
ampv
+4,
-0
1@@ -4,6 +4,7 @@ musicdir=$HOME/usr/Music
2 socket=/tmp/.mpvsocket
3 playlist=$home/usr/ampv-playlist
4 tmpfile=/tmp/.ampv.tmp
5+menu=(dmenu -i -l 20)
6
7 fn player {mpv '--input-ipc-server='$socket $*}
8 fn tosocket {printf '{ "command": '$*' }\n' | nc -UN $socket}
9@@ -15,6 +16,9 @@ switch($1) {
10 case -a
11 songfile=`{getfilepath}
12 printf '%s\n' $"songfile >> $playlist
13+ case -A
14+ song=`{find $musicdir -type f -name *.opus | $menu}
15+ printf 'loadfile '$song' append\n' | nc -UN $socket
16 case -d
17 songfile=`{getfilepath}
18 grep -v $"songfile $playlist > $tmpfile