From 01bd13a3b555f0e8b4eb201c1a68423a1bd7bcf7 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 19 Jun 2018 09:37:10 +1000 Subject: [PATCH] song: Fix detection. --- neofetch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index d33d6ea6..8737d3fc 100755 --- a/neofetch +++ b/neofetch @@ -2340,7 +2340,8 @@ get_song() { ) printf -v players "|%s" "${players[@]}" - player="$(ps -e | awk -v pattern="(${players:1})$" '$0 ~ pattern {print $NF; exit}')" + player="$(ps aux | awk -v pattern="(${players:1})" \ + '!/ awk / && match($0,pattern){print substr($0,RSTART,RLENGTH); exit}')" [[ "$music_player" && "$music_player" != "auto" ]] && \ player="$music_player"