Hopefully this fixes DESKTOP_SESSION issues presented in #711

This commit is contained in:
KittyKatt
2021-03-19 08:50:30 -05:00
parent eb635a7e78
commit e9ee998e4b

View File

@@ -2078,7 +2078,17 @@ detectde () {
if [[ -z "$DE" || "$DE" = "Not Present" ]]; then
# fallback to checking $DESKTOP_SESSION
case "${DESKTOP_SESSION,,}" in
local _DESKTOP_SESSION=
if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
if [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -gt 1 ]] || [[ ${BASH_VERSINFO[0]} -gt 4 ]]; then
_DESKTOP_SESSION=${DESKTOP_SESSION,,}
else
_DESKTOP_SESSION="$(tr '[:upper:]' '[:lower:]' <<< "${DESKTOP_SESSION}")"
fi
else
_DESKTOP_SESSION="$(tr '[:upper:]' '[:lower:]' <<< "${DESKTOP_SESSION}")"
fi
case "${_DESKTOP_SESSION}" in
'gnome'*)
DE="GNOME"
;;