bin/disorder-play-on-demand: Script to set up on-demand playing. master
authorMark Wooding <mdw@distorted.org.uk>
Mon, 29 Apr 2024 11:16:33 +0000 (12:16 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 29 Apr 2024 11:16:33 +0000 (12:16 +0100)
Makefile
bin/disorder-play-on-demand [new file with mode: 0755]

index e650635..8bfcef2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -250,7 +250,7 @@ SCRIPTLINKS         += fixsub
 SCRIPTLINKS            += check-debsyms
 SCRIPTLINKS            += check-blkdev-size
 SCRIPTLINKS            += xremote
-SCRIPTLINKS            += remote-disorder
+SCRIPTLINKS            += disorder-play-on-demand remote-disorder
 SCRIPTLINKS            += remote-slideshow
 
 ## Random odds and ends.
diff --git a/bin/disorder-play-on-demand b/bin/disorder-play-on-demand
new file mode 100755 (executable)
index 0000000..cdf6887
--- /dev/null
@@ -0,0 +1,9 @@
+#! /bin/sh -e
+
+hostname=$(hostname)
+locking -fx $HOME/.disorder/$hostname-local.lock \
+  sh -ec "exec </dev/null >>$HOME/.disorder/$hostname-local.log 2>&1 \
+           \"\$@\"" . \
+  disorder-ondemand -u$HOME/.disorder/passwd.local -- \
+  disorder-playrtp -Apulseaudio -u$HOME/.disorder/passwd.local \
+         --socket $HOME/.disorder/$hostname-local