From d6323807281544d09900bfb2dab7ebb4d5c3dd6c Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 23 Dec 2016 00:25:23 +1100 Subject: [PATCH 1/5] DE: Fix duplicate DE/WM --- neofetch | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index e7ce69e5..ca47723a 100755 --- a/neofetch +++ b/neofetch @@ -541,8 +541,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 +556,9 @@ get_de() { elif [[ "$MATE_DESKTOP_SESSION_ID" ]]; then de="MATE" fi + + # If DE == WM unset DE. + de="${de/${wm}}" ;; esac From 5e3a3997e2f56075770d7b2b89f48ced30042fb2 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 23 Dec 2016 00:29:09 +1100 Subject: [PATCH 2/5] DE: Fix case issue --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index ca47723a..1a862b98 100755 --- a/neofetch +++ b/neofetch @@ -558,7 +558,7 @@ get_de() { fi # If DE == WM unset DE. - de="${de/${wm}}" + [[ "$de" == "$wm" ]] && unset -v de ;; esac From 9b7e84a553c10c876d64380de98d1f4480039e8b Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 23 Dec 2016 00:32:22 +1100 Subject: [PATCH 3/5] DE: Fix match --- neofetch | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 1a862b98..ac5f0985 100755 --- a/neofetch +++ b/neofetch @@ -558,7 +558,7 @@ get_de() { fi # If DE == WM unset DE. - [[ "$de" == "$wm" ]] && unset -v de + [[ "$de" =~ $wm ]] && unset -v de ;; esac @@ -582,6 +582,8 @@ get_de() { } get_wm() { + (( "$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)" From 4d8bebec4bdb393b2fd1a971f2baebc079a5145c Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 23 Dec 2016 00:38:21 +1100 Subject: [PATCH 4/5] Info: Log if function was used before --- neofetch | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/neofetch b/neofetch index ac5f0985..c29429c1 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") @@ -582,6 +585,7 @@ get_de() { } get_wm() { + # If function was run, stop here. (( "$wm_run" == 1 )) && return if [[ -n "$DISPLAY" && "$os" != "Mac OS X" ]]; then @@ -1487,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") From d396e529240fa686eae438eebf65bc0222c6ca5d Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 23 Dec 2016 00:39:39 +1100 Subject: [PATCH 5/5] DE: Exit function if DE == WM --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index c29429c1..bf0f65a2 100755 --- a/neofetch +++ b/neofetch @@ -561,7 +561,7 @@ get_de() { fi # If DE == WM unset DE. - [[ "$de" =~ $wm ]] && unset -v de + [[ "$de" =~ $wm ]] && { unset -v de; return; } ;; esac