ref: 3d98f22b01f61b93c3bcc6ffe3f0eb0fa2d01f98
parent: 54f9bc11d6900ebb24697d70db213ace24f3578e
author: qwx <qwx@sciops.net>
date: Thu Jan 9 09:29:54 EST 2020
add play: play(1) auxiliary scripts see: http://nopenopenope.net/posts/play
--- /dev/null
+++ b/play/fn
@@ -1,0 +1,18 @@
+# skip to next track
+fn fw{ for(i in `{fpl}) echo 'echo kill >/proc/'^$i^/note }
+# pause playback
+fn sto{ for(i in `{fpl}) echo 'echo stop >/proc/'^$i^/ctl }
+# resume playback
+fn sta{ for(i in `{fpl}) echo 'echo start >/proc/'^$i^/ctl }
+
+# shortcuts for first play(1) process
+fn Fw{ fw | sed 1q | rc }
+fn Sta{ sta | sed 1q | rc }
+fn Sto{ sto | sed 1q | rc }
+
+# recursively list all files in arguments and play shuffled list forever
+fn shp{ *=`"{lr -Q $*}; while(! ~ $#* 0) play `'
+' {echo -n $* | shl} }
+
+# shuffle play pre-arranged list of files forever
+fn shpp{ status='' while(~ $status '') play `{shl <$1} }
--- /dev/null
+++ b/play/fpl
@@ -1,0 +1,6 @@
+#!/bin/rc
+ps -n | awk '
+/ play$/ { g[++i] = $3 }
+{ for(n=1; n<=i; n++) if(g[n] == $3) p[n] = $2 }
+END { for(n=1; n<=i; n++) print p[n] }
+'