Fix processes with paths in name'

This commit is contained in:
Dylan Araps 2016-10-26 18:09:59 +11:00
parent 76c6c18cee
commit 0c41c285a7
1 changed files with 1 additions and 1 deletions

View File

@ -1122,7 +1122,7 @@ getmemory() {
getsong() { getsong() {
player="$(ps x | awk '!(/awk|Helper|Cache/) && /mpd|cmus|mocp|spotify|Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious/ {printf $5 " " $6; exit}')" player="$(ps x | awk '!(/awk|Helper|Cache/) && /mpd|cmus|mocp|spotify|Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious/ {printf $5 " " $6; exit}')"
case "$player" in case "${player/*\/}" in
"mpd"*) "mpd"*)
song="$(mpc current 2>/dev/null)" song="$(mpc current 2>/dev/null)"
state="$(mpc | awk -F '\\[|\\]' '/\[/ {printf $2}' 2>/dev/null)" state="$(mpc | awk -F '\\[|\\]' '/\[/ {printf $2}' 2>/dev/null)"