Compare commits

...

2 commits

Author SHA1 Message Date
476bda1963
Use mpv input-ipc instead of input-file on mpvqueue script
Fixes #3
2021-02-12 19:06:35 +02:00
92b9dc4340
Update dotdrop 2021-02-12 19:06:24 +02:00
2 changed files with 8 additions and 8 deletions

@ -1 +1 @@
Subproject commit 39d52a2c8042d250f0258b1135d7d94e37a14e8f
Subproject commit 06842103672ad8f394b39e5fea2c1ab4442c1f44

View file

@ -1,23 +1,23 @@
#!/usr/bin/env bash
MPVPIPE=/tmp/mpvqueue.playlist
notify="notify-send -i mpv -a mpv"
url="$1"
# NOTE: You need to configure mpv to
# enable ipc server on this path (see my mpv config for an example)
MPVSOCKET="/tmp/mpvsocket"
# See if MPV is already running
if [ -z "$(pidof mpv)" ]; then
# mpv is not running
# remove fifo
rm -f $MPVPIPE && mkfifo $MPVPIPE
# pause other players
playerctl pause
# start mpv
/usr/bin/mpv --no-terminal --input-file="${MPVPIPE}" "$url" & disown
/usr/bin/mpv --no-terminal "$url" & disown
# Wait for mpv to be up before moving on to adding anything else to playlist
# Wait for mpv to be up before adding anything else to playlist
while [ -z "$(pidof mpv)" ]; do
sleep 1
done
@ -26,5 +26,5 @@ if [ -z "$(pidof mpv)" ]; then
else
# mpv is running, so add stuff to playlist
$notify "Adding $url"
echo "loadfile \"$url\" append-play" >> "${MPVPIPE}"
echo "{\"command\": [\"loadfile\", \"$url\", \"append\"]}" | socat - /tmp/mpvsocket
fi