Add test for clementine running

This commit is contained in:
Knah Tsaeb 2016-12-22 10:52:26 +01:00
parent b607b9a60a
commit 675c1a4869

8
cctine
View file

@ -1,5 +1,4 @@
#!/bin/bash #!/bin/bash
if [ -z $1 ] if [ -z $1 ]
then then
echo "Help echo "Help
@ -15,6 +14,13 @@ You need parameter :
exit exit
fi fi
clementineProcess=$(qdbus | grep clementine | wc -l)
if [ $clementineProcess == 0 ]
then
exit 0
fi
if [ $1 == 'title' ] if [ $1 == 'title' ]
then then
echo $(qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep -e "title:"| cut -d " " -f2-) echo $(qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep -e "title:"| cut -d " " -f2-)