Merge pull request #212 from dylanaraps/de_detection
Better DE detection.
This commit is contained in:
commit
19bab6499d
9
1.7.md
9
1.7.md
|
@ -1 +1,10 @@
|
||||||
# Neofetch 1.7
|
# Neofetch 1.7
|
||||||
|
|
||||||
|
### Contributers
|
||||||
|
|
||||||
|
|
||||||
|
### Info
|
||||||
|
|
||||||
|
**Desktop Environment**<br \>
|
||||||
|
- [ Linux ] Fallback to using `xprop` if `$XDG_CURRENT_DESKTOP` is empty.
|
||||||
|
- Use `$de` instead of `$XDG_CURRENT_DESKTOP` for wallpaper and theme detection.
|
||||||
|
|
28
neofetch
28
neofetch
|
@ -775,8 +775,23 @@ getshell () {
|
||||||
getde () {
|
getde () {
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Mac OS X") de="Aqua" ;;
|
"Mac OS X") de="Aqua" ;;
|
||||||
*) de="${XDG_CURRENT_DESKTOP/i3}" ;;
|
*)
|
||||||
|
de="${XDG_CURRENT_DESKTOP/i3}"
|
||||||
|
de=${de/'X-'}
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if [ -z "$de" ]; then
|
||||||
|
de="$(xprop -root | awk '/KDE_SESSION_VERSION|^_MARCO|^_MUFFIN|xfce4|xfce5/')"
|
||||||
|
|
||||||
|
case "$de" in
|
||||||
|
"KDE_SESSION_VERSION"*) de="KDE${de/* = }" ;;
|
||||||
|
*"MUFFIN"*) de="Cinnamon" ;;
|
||||||
|
*"MARCO"*) de="MATE" ;;
|
||||||
|
*"xfce4"*) de="XFCE4" ;;
|
||||||
|
*"xfce5"*) de="XFCE5" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
@ -1416,8 +1431,10 @@ getstyle () {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ -n "$DISPLAY" ] && [ "$os" != "Mac OS X" ]; then
|
if [ -n "$DISPLAY" ] && [ "$os" != "Mac OS X" ]; then
|
||||||
# Current DE
|
# Get DE if user has disabled the function.
|
||||||
case "$XDG_CURRENT_DESKTOP" in
|
[ -z "$de" ] && getde
|
||||||
|
|
||||||
|
case "$de" in
|
||||||
"KDE"*)
|
"KDE"*)
|
||||||
kdeconfigdir
|
kdeconfigdir
|
||||||
|
|
||||||
|
@ -1855,7 +1872,10 @@ getwallpaper () {
|
||||||
img="$(awk -F'=' '/file/ {printf $2;exit;}' "$XDG_CONFIG_HOME/nitrogen/bg-saved.cfg")"
|
img="$(awk -F'=' '/file/ {printf $2;exit;}' "$XDG_CONFIG_HOME/nitrogen/bg-saved.cfg")"
|
||||||
|
|
||||||
elif type -p gsettings >/dev/null 2>&1; then
|
elif type -p gsettings >/dev/null 2>&1; then
|
||||||
case "$XDG_CURRENT_DESKTOP" in
|
# Get DE if user has disabled the function.
|
||||||
|
[ -z "$de" ] && getde
|
||||||
|
|
||||||
|
case "$de" in
|
||||||
"MATE"*) img="$(gsettings get org.mate.background picture-filename 2>/dev/null)" ;;
|
"MATE"*) img="$(gsettings get org.mate.background picture-filename 2>/dev/null)" ;;
|
||||||
*) img="$(gsettings get org.gnome.desktop.background picture-uri 2>/dev/null)" ;;
|
*) img="$(gsettings get org.gnome.desktop.background picture-uri 2>/dev/null)" ;;
|
||||||
esac
|
esac
|
||||||
|
|
Reference in New Issue