From 8937f07daa2ce3193dfa94830df930718167826b Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 2 Apr 2016 01:51:32 +1100 Subject: [PATCH 01/10] Base DE detection --- neofetch | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/neofetch b/neofetch index 20f33a65..3ffc0f1e 100755 --- a/neofetch +++ b/neofetch @@ -777,6 +777,12 @@ getde () { "Mac OS X") de="Aqua" ;; *) de="${XDG_CURRENT_DESKTOP/i3}" ;; esac + + # TODO: Add support for all DEs that have xprop values. + if [ -z "$de" ]; then + de="$(xprop -root | awk -F '= ' '/KDE_SESSION_VERSION/ {printf $2}')" + + fi } # }}} From 22f50e634f9293723cacffb6564e1b7f7e0e0632 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 2 Apr 2016 01:55:31 +1100 Subject: [PATCH 02/10] Add KDE support to xprop DE detection --- neofetch | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 3ffc0f1e..c1e40bfc 100755 --- a/neofetch +++ b/neofetch @@ -780,8 +780,12 @@ getde () { # TODO: Add support for all DEs that have xprop values. if [ -z "$de" ]; then - de="$(xprop -root | awk -F '= ' '/KDE_SESSION_VERSION/ {printf $2}')" + de="$(xprop -root | awk '/KDE_SESSION_VERSION|^_MARCO|^_MUFFIN|xfce4|xfce5/')" + case "$de" in + "KDE_SESSION_VERSION"*) de="KDE${de/* = }" ;; + + esac fi } From 7e5863dd83d0aa251333318d50c8b09c07d0bad9 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 2 Apr 2016 01:59:46 +1100 Subject: [PATCH 03/10] Don't hardcode theme/wallpaper detection to XDG_CURRENT_DESKTOP, instead use '' --- neofetch | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index c1e40bfc..9598d1b0 100755 --- a/neofetch +++ b/neofetch @@ -1426,8 +1426,10 @@ getstyle () { esac if [ -n "$DISPLAY" ] && [ "$os" != "Mac OS X" ]; then - # Current DE - case "$XDG_CURRENT_DESKTOP" in + # Get DE if user has disabled the function. + [ -z "$de" ] && getde + + case "$de" in "KDE"*) kdeconfigdir @@ -1865,7 +1867,10 @@ getwallpaper () { img="$(awk -F'=' '/file/ {printf $2;exit;}' "$XDG_CONFIG_HOME/nitrogen/bg-saved.cfg")" elif type -p gsettings >/dev/null 2>&1; then - case "$XDG_CURRENT_DESKTOP" in + # Get DE if user has disabled the function. + [ -z "$de" ] && getde + + case "$de" in "MATE"*) img="$(gsettings get org.mate.background picture-filename 2>/dev/null)" ;; *) img="$(gsettings get org.gnome.desktop.background picture-uri 2>/dev/null)" ;; esac From 87589110b3363656ed7274c9e7cf66789a076693 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 2 Apr 2016 02:17:36 +1100 Subject: [PATCH 04/10] Add support for Muffin --- neofetch | 1 + 1 file changed, 1 insertion(+) diff --git a/neofetch b/neofetch index 9598d1b0..d0f0f952 100755 --- a/neofetch +++ b/neofetch @@ -784,6 +784,7 @@ getde () { case "$de" in "KDE_SESSION_VERSION"*) de="KDE${de/* = }" ;; + *"MUFFIN"*) de="Cinnamon" ;; esac fi From dda95387de63433593f97e208d9c6013a146a231 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 2 Apr 2016 02:22:08 +1100 Subject: [PATCH 05/10] Remove 'X-' from de name --- neofetch | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index d0f0f952..f6cbd905 100755 --- a/neofetch +++ b/neofetch @@ -775,7 +775,10 @@ getshell () { getde () { case "$os" in "Mac OS X") de="Aqua" ;; - *) de="${XDG_CURRENT_DESKTOP/i3}" ;; + *) + de="${XDG_CURRENT_DESKTOP/i3}" + de=${de/'X-'} + ;; esac # TODO: Add support for all DEs that have xprop values. From 88be4fc5410a07a8cae2a149dbfcbb1e136c922c Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 2 Apr 2016 02:26:31 +1100 Subject: [PATCH 06/10] Add support for XFCE --- neofetch | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index f6cbd905..ddbb0ee4 100755 --- a/neofetch +++ b/neofetch @@ -788,7 +788,9 @@ getde () { case "$de" in "KDE_SESSION_VERSION"*) de="KDE${de/* = }" ;; *"MUFFIN"*) de="Cinnamon" ;; - + *"MARCO"*) de="MATE" ;; + *"xfce4") de="XFCE4" ;; + *"xfce5") de="XFCE5" ;; esac fi } From baf86efb9589d3b764112f1f6b755ec4582ef442 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 2 Apr 2016 02:27:25 +1100 Subject: [PATCH 07/10] Fix matching error --- neofetch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index ddbb0ee4..0a739046 100755 --- a/neofetch +++ b/neofetch @@ -789,8 +789,8 @@ getde () { "KDE_SESSION_VERSION"*) de="KDE${de/* = }" ;; *"MUFFIN"*) de="Cinnamon" ;; *"MARCO"*) de="MATE" ;; - *"xfce4") de="XFCE4" ;; - *"xfce5") de="XFCE5" ;; + *"xfce4"*) de="XFCE4" ;; + *"xfce5"*) de="XFCE5" ;; esac fi } From 0f61ac53e36a21ec1514a3caa8a6c08cf3b5df79 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 2 Apr 2016 02:29:56 +1100 Subject: [PATCH 08/10] Remove TODO line --- neofetch | 1 - 1 file changed, 1 deletion(-) diff --git a/neofetch b/neofetch index 0a739046..16a09520 100755 --- a/neofetch +++ b/neofetch @@ -781,7 +781,6 @@ getde () { ;; esac - # TODO: Add support for all DEs that have xprop values. if [ -z "$de" ]; then de="$(xprop -root | awk '/KDE_SESSION_VERSION|^_MARCO|^_MUFFIN|xfce4|xfce5/')" From f9a1db57e0a17300d443743df2911deb21555326 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 2 Apr 2016 02:31:10 +1100 Subject: [PATCH 09/10] Changelog --- 1.7.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/1.7.md b/1.7.md index 0bdd19a1..e5481d9f 100644 --- a/1.7.md +++ b/1.7.md @@ -1 +1,9 @@ # Neofetch 1.7 + +### Contributers + + +### Info + +**Desktop Environment**
+- [ Linux ] Fallback to using `xprop` if `$XDG_CURRENT_DESKTOP` is empty. From 7ce4b95a3423ce00d6093ea2149e4e00395e1742 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 2 Apr 2016 02:32:56 +1100 Subject: [PATCH 10/10] Changelog --- 1.7.md | 1 + 1 file changed, 1 insertion(+) diff --git a/1.7.md b/1.7.md index e5481d9f..486fee50 100644 --- a/1.7.md +++ b/1.7.md @@ -7,3 +7,4 @@ **Desktop Environment**
- [ Linux ] Fallback to using `xprop` if `$XDG_CURRENT_DESKTOP` is empty. +- Use `$de` instead of `$XDG_CURRENT_DESKTOP` for wallpaper and theme detection.