getsong, check to see if music player is running
This commit is contained in:
parent
a1c9452bda
commit
c8b41da31c
6
fetch
6
fetch
|
@ -1098,16 +1098,16 @@ getmemory () {
|
||||||
# Song {{{
|
# Song {{{
|
||||||
|
|
||||||
getsong () {
|
getsong () {
|
||||||
if type -p mpc >/dev/null 2>&1; then
|
if pgrep "mpd" >/dev/null 2>&1; then
|
||||||
song="$(mpc current)"
|
song="$(mpc current)"
|
||||||
|
|
||||||
elif type -p cmus >/dev/null 2>&1; then
|
elif pgrep "cmus" >/dev/null 2>&1; then
|
||||||
song="$(cmus-remote -Q | grep "tag artist\|title")"
|
song="$(cmus-remote -Q | grep "tag artist\|title")"
|
||||||
song=${song/tag artist }
|
song=${song/tag artist }
|
||||||
song=${song/tag title/-}
|
song=${song/tag title/-}
|
||||||
song=${song//[[:space:]]/ }
|
song=${song//[[:space:]]/ }
|
||||||
|
|
||||||
elif type -p mocp >/dev/null 2>&1; then
|
elif pgrep "mocp" >/dev/null 2>&1; then
|
||||||
song="$(mocp -Q "%artist - %song")"
|
song="$(mocp -Q "%artist - %song")"
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
Reference in New Issue