From 3b4a1864bd46ccc815e136ba63c6408224c6cdc7 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 5 Dec 2016 09:29:41 +1100 Subject: [PATCH] DE: Print Cinnamon version, closes #494 --- neofetch | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/neofetch b/neofetch index 3454b4e5..b2c8e4e7 100755 --- a/neofetch +++ b/neofetch @@ -552,17 +552,18 @@ get_de() { ;; esac - if [[ -n "$DISPLAY" && -z "$de" ]]; then + # Fallback to using xprop. + [[ -n "$DISPLAY" && -z "$de" ]] && \ de="$(xprop -root | awk '/KDE_SESSION_VERSION|^_MUFFIN|xfce4|xfce5/')" - case "$de" in - "KDE_SESSION_VERSION"*) de="KDE${de/* = }" ;; - *"TDE_FULL_SESSION"*) de="Trinity" ;; - *"MUFFIN"*) de="$(cinnamon --version)"; de="${de:-Cinnamon}" ;; - *"xfce4"*) de="XFCE4" ;; - *"xfce5"*) de="XFCE5" ;; - esac - fi + # Format strings + case "$de" in + "KDE_SESSION_VERSION"*) de="KDE${de/* = }" ;; + *"TDE_FULL_SESSION"*) de="Trinity" ;; + *"MUFFIN"* | "Cinnamon") de="$(cinnamon --version)"; de="${de:-Cinnamon}" ;; + *"xfce4"*) de="XFCE4" ;; + *"xfce5"*) de="XFCE5" ;; + esac } get_wm() {