getsong, check to see if music player is running
This commit is contained in:
parent
a1c9452bda
commit
c8b41da31c
1 changed files with 3 additions and 3 deletions
6
fetch
6
fetch
|
@ -1098,16 +1098,16 @@ getmemory () {
|
|||
# Song {{{
|
||||
|
||||
getsong () {
|
||||
if type -p mpc >/dev/null 2>&1; then
|
||||
if pgrep "mpd" >/dev/null 2>&1; then
|
||||
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=${song/tag artist }
|
||||
song=${song/tag title/-}
|
||||
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")"
|
||||
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue