From 5dc00cba146dd34ce9385344c729ccd0451f5449 Mon Sep 17 00:00:00 2001 From: Ryan Hanson <13651296+rxhanson@users.noreply.github.com> Date: Sat, 10 Aug 2019 17:41:21 -0400 Subject: [PATCH] Removed subshell from ps grep for macOS wm --- neofetch | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/neofetch b/neofetch index 2d3adf8b..4b3d9fd0 100755 --- a/neofetch +++ b/neofetch @@ -1631,18 +1631,13 @@ get_wm() { else case "$os" in "Mac OS X") - wm_names=( - "[S]pectacle" - "[A]methyst" - "[k]wm" - "[c]hun[k]wm" - "[y]abai" - "[R]ectangle" - ) - - regex_part=$( IFS='|'; echo "${wm_names[*]}" ) - - ps_line=$(ps -e | grep -Eo "$regex_part") + ps_line="$(ps -e | grep -o \ + -e "[S]pectacle" \ + -e "[A]methyst" \ + -e "[k]wm" \ + -e "[c]hun[k]wm" \ + -e "[y]abai" \ + -e "[R]ectangle")" case "$ps_line" in *"chunkwm"*) wm="chunkwm" ;;