mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Detect if MOC is playing
This commit is contained in:
parent
5c591422dc
commit
8fff4643f5
|
@ -59,15 +59,25 @@ fi
|
||||||
if [ -z "$ret" ]; then
|
if [ -z "$ret" ]; then
|
||||||
# mocp not running
|
# mocp not running
|
||||||
mocp -S
|
mocp -S
|
||||||
|
else
|
||||||
|
# mocp running, check if it's playing
|
||||||
|
state=$(mocp -i | grep "State:" | cut -d' ' -f2)
|
||||||
|
|
||||||
|
if [ $state = 'PLAY' ]; then
|
||||||
|
# add to playlist and exit
|
||||||
|
mocp_add "$1"
|
||||||
|
|
||||||
|
# uncomment the line below to show mocp interface after appending
|
||||||
|
# mocp
|
||||||
|
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# clear selection and play
|
# clear selection and play
|
||||||
mocp -c
|
mocp -c
|
||||||
mocp_add "$1"
|
mocp_add "$1"
|
||||||
mocp -p
|
mocp -p
|
||||||
else
|
|
||||||
# mocp running, just append
|
|
||||||
mocp_add "$1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# uncomment the line below to show mocp interface after appending
|
# uncomment the line below to show mocp interface after appending
|
||||||
# mocp
|
# mocp
|
||||||
|
|
Loading…
Reference in a new issue