Reduce macOS WM detections to one ps call

This commit is contained in:
Jorge Gonzalez 2017-03-21 18:37:41 -04:00
parent 1bd185874c
commit 0c4d4eb23a
No known key found for this signature in database
GPG key ID: AD2671B01BB1E086

View file

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