From bac9dcf3f4a347f8364d293a38d8d1390994be7d Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 2 Feb 2018 09:46:18 +1100 Subject: [PATCH] song: Use grep instead of awk. --- neofetch | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 8dd79d3e..c23cf985 100755 --- a/neofetch +++ b/neofetch @@ -1522,7 +1522,36 @@ get_memory() { } get_song() { - player="$(ps x | awk '!(/ awk|Helper|Cache|ibus|indicator/) && /mpd|mopidy|cmus|mocp|[Ss]potify|Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious|xmms2d|gnome-music|lollypop|clementine|pragha|exaile|juk|bluemindo|guayadeque|yarock|qmmp|quodlibet|deepin-music|tomahawk|pogo|elisa/ {printf $5 " " $6; exit}')" + player="$(ps -e | grep -m 1 -o -F \ + -e "Google Play" \ + -e "Spotify" \ + -e "amarok" \ + -e "audacious" \ + -e "banshee" \ + -e "bluemindo" \ + -e "clementine" \ + -e "cmus" \ + -e "deadbeef" \ + -e "deepin-music" \ + -e "elisa" \ + -e "exaile" \ + -e "gnome-music" \ + -e "guayadeque" \ + -e "iTunes.app" \ + -e "juk" \ + -e "lollypop" \ + -e "mocp" \ + -e "mopidy" \ + -e "mpd" \ + -e "pogo" \ + -e "pragha" \ + -e "qmmp" \ + -e "quodlibet" \ + -e "rhythmbox" \ + -e "spotify" \ + -e "tomahawk" \ + -e "xmms2d" \ + -e "yarock")" get_song_dbus() { # Multiple players use an almost identical dbus command to get the information.