Merge pull request #523 from dylanaraps/de

DE: Better Desktop Environment Detection.
This commit is contained in:
Dylan Araps 2016-12-13 12:04:48 +11:00 committed by GitHub
commit 4ce470e6b8
1 changed files with 16 additions and 3 deletions

View File

@ -537,9 +537,20 @@ get_de() {
;; ;;
*) *)
de="${XDG_CURRENT_DESKTOP/i3}" if [[ "$XDG_CURRENT_DESKTOP" ]]; then
de="${de/'X-'}" de="${XDG_CURRENT_DESKTOP/i3}"
de="${de/Budgie:GNOME/Budgie}" de="${de/'X-'}"
de="${de/Budgie:GNOME/Budgie}"
elif [[ "$DESKTOP_SESSION" ]]; then
de="${DESKTOP_SESSION/ *}"
elif [[ "$GOME_DESKTOP_SESSION_ID" ]]; then
de="GNOME"
elif [[ "$MATE_DESKTOP_SESSION_ID" ]]; then
de="MATE"
fi
;; ;;
esac esac
@ -554,6 +565,8 @@ get_de() {
*"MUFFIN"* | "Cinnamon") de="$(cinnamon --version)"; de="${de:-Cinnamon}" ;; *"MUFFIN"* | "Cinnamon") de="$(cinnamon --version)"; de="${de:-Cinnamon}" ;;
*"xfce4"*) de="XFCE4" ;; *"xfce4"*) de="XFCE4" ;;
*"xfce5"*) de="XFCE5" ;; *"xfce5"*) de="XFCE5" ;;
*"xfce"*) de="XFCE" ;;
*"mate"*) de="MATE" ;;
esac esac
# Log that the function was run. # Log that the function was run.