diff --git a/neofetch b/neofetch index 80f2f4c3..47e12aef 100755 --- a/neofetch +++ b/neofetch @@ -531,6 +531,9 @@ get_shell() { } get_de() { + # If function was run, stop here. + (( "$de_run" == 1 )) && return + case "$os" in "Mac OS X") de="Aqua" ;; "Windows") @@ -541,8 +544,9 @@ get_de() { ;; *) + (( "$wm_run" != 1 )) && get_wm + if [[ "$XDG_CURRENT_DESKTOP" ]]; then - de="${XDG_CURRENT_DESKTOP/i3}" de="${de/'X-'}" de="${de/Budgie:GNOME/Budgie}" @@ -555,6 +559,9 @@ get_de() { elif [[ "$MATE_DESKTOP_SESSION_ID" ]]; then de="MATE" fi + + # If DE == WM unset DE. + [[ "$de" =~ $wm ]] && { unset -v de; return; } ;; esac @@ -578,6 +585,9 @@ get_de() { } get_wm() { + # If function was run, stop here. + (( "$wm_run" == 1 )) && return + if [[ -n "$DISPLAY" && "$os" != "Mac OS X" ]]; then id="$(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}')" wm="$(xprop -id "$id" -notype -f _NET_WM_NAME 8t)" @@ -1481,6 +1491,9 @@ get_font() { } get_term() { + # If function was run, stop here. + (( "$term_run" == 1 )) && return + # Check $PPID for terminal emulator. case "$os" in "Mac OS X")