Reduce macOS WM detections to one ps call

parent 1bd18587
...@@ -636,10 +636,17 @@ get_wm() { ...@@ -636,10 +636,17 @@ get_wm() {
else else
case "$os" in case "$os" in
"Mac OS X") "Mac OS X")
wm="Quartz Compositor" ps_line="$(ps -e | grep -o '[S]pectacle\|[A]methyst\|[k]wm')"
ps -e | grep -q '[S]pectacle' && wm='Spectacle'
ps -e | grep -q "[A]methyst" && wm="Amethyst" if echo "$ps_line" | grep -q "kwm"; then
ps -e | grep -q "[k]wm" && wm="Kwm" wm="Kwm"
elif echo "$ps_line" | grep -q "Amethyst"; then
wm="Amethyst"
elif echo "$ps_line" | grep -q "Spectacle"; then
wm="Spectacle"
else
wm="Quartz Compositor"
fi
;; ;;
"Windows") "Windows")
......
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