mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-23 12:09:55 +00:00
Refactored grep for macOS window manager detection
Co-Authored-By: nibblonian <ted+github@rusts.net>
This commit is contained in:
13
neofetch
13
neofetch
@@ -1631,7 +1631,18 @@ 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\|[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
|
case "$ps_line" in
|
||||||
*"chunkwm"*) wm="chunkwm" ;;
|
*"chunkwm"*) wm="chunkwm" ;;
|
||||||
|
|||||||
Reference in New Issue
Block a user