Merge pull request #555 from dylanaraps/wm-fix

DE: Fix cases where WM == DE
This commit is contained in:
Dylan Araps 2016-12-23 01:10:34 +11:00 committed by GitHub
commit faf577ccc0

View file

@ -531,6 +531,9 @@ get_shell() {
} }
get_de() { get_de() {
# If function was run, stop here.
(( "$de_run" == 1 )) && return
case "$os" in case "$os" in
"Mac OS X") de="Aqua" ;; "Mac OS X") de="Aqua" ;;
"Windows") "Windows")
@ -541,8 +544,9 @@ get_de() {
;; ;;
*) *)
(( "$wm_run" != 1 )) && get_wm
if [[ "$XDG_CURRENT_DESKTOP" ]]; then if [[ "$XDG_CURRENT_DESKTOP" ]]; then
de="${XDG_CURRENT_DESKTOP/i3}"
de="${de/'X-'}" de="${de/'X-'}"
de="${de/Budgie:GNOME/Budgie}" de="${de/Budgie:GNOME/Budgie}"
@ -555,6 +559,9 @@ get_de() {
elif [[ "$MATE_DESKTOP_SESSION_ID" ]]; then elif [[ "$MATE_DESKTOP_SESSION_ID" ]]; then
de="MATE" de="MATE"
fi fi
# If DE == WM unset DE.
[[ "$de" =~ $wm ]] && { unset -v de; return; }
;; ;;
esac esac
@ -578,6 +585,9 @@ get_de() {
} }
get_wm() { get_wm() {
# If function was run, stop here.
(( "$wm_run" == 1 )) && return
if [[ -n "$DISPLAY" && "$os" != "Mac OS X" ]]; then if [[ -n "$DISPLAY" && "$os" != "Mac OS X" ]]; then
id="$(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}')" id="$(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}')"
wm="$(xprop -id "$id" -notype -f _NET_WM_NAME 8t)" wm="$(xprop -id "$id" -notype -f _NET_WM_NAME 8t)"
@ -1481,6 +1491,9 @@ get_font() {
} }
get_term() { get_term() {
# If function was run, stop here.
(( "$term_run" == 1 )) && return
# Check $PPID for terminal emulator. # Check $PPID for terminal emulator.
case "$os" in case "$os" in
"Mac OS X") "Mac OS X")