Change if statement to a switch
This commit is contained in:
parent
0c4d4eb23a
commit
6803b571b7
1 changed files with 6 additions and 9 deletions
15
neofetch
15
neofetch
|
@ -638,15 +638,12 @@ get_wm() {
|
|||
"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"
|
||||
fi
|
||||
case "$ps_line" in
|
||||
*"kwm"*) wm="Kwm" ;;
|
||||
*"Amethyst"*) wm="Amethyst" ;;
|
||||
*"Spectacle"*) wm="Spectacle" ;;
|
||||
*) wm="Quartz Compositor" ;;
|
||||
esac
|
||||
;;
|
||||
|
||||
"Windows")
|
||||
|
|
Loading…
Reference in a new issue