Working on neomutt setup and some other small fixes
This commit is contained in:
parent
ab9bd17296
commit
ddbee7f692
36 changed files with 152 additions and 155 deletions
30
scripts/media/mpvqueue
Executable file
30
scripts/media/mpvqueue
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
MPVPIPE=/tmp/mpvqueue.playlist
|
||||
|
||||
notify="notify-send -i mpv -a mpv"
|
||||
url="$1"
|
||||
|
||||
# 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
|
||||
|
||||
# Wait for mpv to be up before moving on to adding anything else to playlist
|
||||
while [ -z "$(pidof mpv)" ]; do
|
||||
sleep 1
|
||||
done
|
||||
$notify "Playing $url"
|
||||
|
||||
else
|
||||
# mpv is running, so add stuff to playlist
|
||||
$notify "Adding $url"
|
||||
echo "loadfile \"$url\" append-play" >> "${MPVPIPE}"
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue