Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion neofetch
Original file line number Diff line number Diff line change
Expand Up @@ -1833,17 +1833,27 @@ get_de() {
# the desktop variables are sometimes also set to the
# window manager name. This checks to see if WM == DE
# and discards the DE value.
[[ $de == "$wm" ]] && { unset -v de; return; }
[[ -n "$wm" && ( $de == "$wm" ) ]] && { unset -v de; return; }
;;
esac

# Fallback to using xprop.
[[ $DISPLAY && -z $de ]] && type -p xprop &>/dev/null && \
de=$(xprop -root | awk '/KDE_SESSION_VERSION|^_MUFFIN|xfce4|xfce5/')

# Fallback to exploring displays with xprop for remote sessions.
if [[ -z $DISPLAY && -z $de ]]; then
for display in `seq 0 9`; do
type -p xprop &>/dev/null && \
de=$(xprop -display ":$display" -root | awk '/KDE_SESSION_VERSION|_KDE_NET_WM_|^_MUFFIN|xfce4|xfce5/')
[[ -n "$de" ]] && break
done
fi

# Format strings.
case $de in
KDE_SESSION_VERSION*) de=KDE${de/* = } ;;
*_KDE_NET_WM_*) de=KDE ;;
*xfce4*) de=Xfce4 ;;
*xfce5*) de=Xfce5 ;;
*xfce*) de=Xfce ;;
Expand Down