Unverified Commit 4548c56e authored by Ryan Hanson's avatar Ryan Hanson Committed by GitHub

Refactored grep for macOS window manager detection

parent 296fb685
......@@ -1631,7 +1631,18 @@ get_wm() {
else
case "$os" in
"Mac OS X")
ps_line="$(ps -e | grep -o '[S]pectacle\|[A]methyst\|[k]wm\|[c]hun[k]wm\|[y]abai\|[R]ectangle')"
wm_names=(
"[S]pectacle"
"[A]methyst"
"[k]wm"
"[c]chun[k]wm"
"[y]abai"
"[R]ectangle"
)
regex_part=$( IFS='|'; echo "${wm_names[*]}" )
ps_line=$(ps -e | grep -Eio "$regex_part")
case "$ps_line" in
*"chunkwm"*) wm="chunkwm" ;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment