Skip to content

Commit

Permalink
Listen to 5555 UDP and create a FIFO for visualization to work.
Browse files Browse the repository at this point in the history
Fixes #1
  • Loading branch information
wernight committed May 8, 2015
1 parent 2adb46b commit d0fe3a7
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .ncmpcpp/config
@@ -0,0 +1,6 @@
audio_output {
type "fifo"
name "my_fifo"
path "/tmp/mopidy.fifo"
format "44100:16:2"
}
10 changes: 8 additions & 2 deletions Dockerfile
Expand Up @@ -4,7 +4,8 @@ MAINTAINER Werner Beroux <werner@beroux.com>

# http://ncmpcpp.rybczak.net/download.php#debian
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
ncmpcpp
ncmpcpp \
netcat-traditional

# Clean-up to save some space
RUN apt-get clean
Expand All @@ -13,6 +14,11 @@ RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Create a random UID to avoid running as root.
RUN useradd --uid 71723 -m ncmpcpp

ADD ncmpcpp.sh /ncmpcpp.sh
RUN chmod o+rx /ncmpcpp.sh

ADD .ncmpcpp/config /home/ncmpcpp/.ncmpcpp/config

USER ncmpcpp

ENTRYPOINT ["ncmpcpp"]
ENTRYPOINT ["/ncmpcpp.sh"]
17 changes: 17 additions & 0 deletions ncmpcpp.sh
@@ -0,0 +1,17 @@
#!/bin/sh

udp_fifo() {
# Start listening to UDP on port 5555 and create a FIFO queue out of it,
# used for visualization. See https://github.com/mopidy/mopidy/issues/775
mkfifo /tmp/mopidy.fifo
while :
do
nc -kluw 1 0.0.0.0 -p 5555 >/tmp/mopidy.fifo 2>/dev/null
sleep 3
done
}

udp_fifo &

# Start actual ncmpcpp
exec ncmpcpp $*

0 comments on commit d0fe3a7

Please sign in to comment.