Added new mediaplayer script for waybar
This commit is contained in:
parent
2b15ddf18e
commit
8b06f68da7
10 changed files with 142 additions and 234 deletions
|
@ -3,13 +3,7 @@
|
|||
MPVPIPE=/tmp/mpvqueue.playlist
|
||||
|
||||
notify="notify-send -i mpv -a mpv"
|
||||
|
||||
# if link is a youtube playlist, clean up url
|
||||
if [[ ${1} =~ /^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu.be))(\/(?:[\w\-]+\?v=|embed\/|v\/)?)([\w\-]+)(\S+)?$ ]]; then
|
||||
url="https://youtube.com/playlist?list=${1#*list=}"
|
||||
else
|
||||
url="$1"
|
||||
fi
|
||||
url="$1"
|
||||
|
||||
# See if MPV is already running
|
||||
if [ -z "$(pidof mpv)" ]; then
|
||||
|
@ -17,6 +11,9 @@ if [ -z "$(pidof mpv)" ]; then
|
|||
# remove fifo
|
||||
rm -f $MPVPIPE && mkfifo $MPVPIPE
|
||||
|
||||
# pause other players
|
||||
playerctl pause
|
||||
|
||||
# start mpv
|
||||
/usr/bin/mpv --no-terminal --input-file="${MPVPIPE}" "$url" & disown
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue