From daf0e25d4fed10c9f2ad398ec67cad73b093b46a Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 5 Dec 2016 13:37:32 +1100 Subject: [PATCH] Wallpaper: Rewrite wallpaper functon. --- neofetch | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/neofetch b/neofetch index 951592b0..ba0b6b60 100755 --- a/neofetch +++ b/neofetch @@ -2042,27 +2042,30 @@ get_w3m_img_path() { get_wallpaper() { case "$os" in "Linux" | "BSD") - if type -p feh >/dev/null && [[ -f "$HOME/.fehbg" ]]; then - image="$(awk -F\' '/feh/ {printf $2}' "$HOME/.fehbg")" + # Get DE if user has disabled the function. + [[ -z "$de" ]] && get_de - elif type -p nitrogen >/dev/null; then - image="$(awk -F'=' '/file/ {printf $2;exit;}' "$XDG_CONFIG_HOME/nitrogen/bg-saved.cfg")" + case "$de" in + "Cinnamon"*) image="$(gsettings get org.cinnamon.desktop.background picture-uri)" ;; + "MATE"*) image="$(gsettings get org.mate.background picture-filename)" ;; + "XFCE"*) image="$(xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/workspace0/last-image)" ;; + *) + if type -p feh >/dev/null && [[ -f "$HOME/.fehbg" ]]; then + image="$(awk -F\' '/feh/ {printf $2}' "$HOME/.fehbg")" - elif type -p gsettings >/dev/null; then - # Get DE if user has disabled the function. - [[ -z "$de" ]] && get_de + elif type -p nitrogen >/dev/null; then + image="$(awk -F'=' '/file/ {printf $2;exit;}' "$XDG_CONFIG_HOME/nitrogen/bg-saved.cfg")" - case "$de" in - "Cinnamon"*) image="$(gsettings get org.cinnamon.desktop.background picture-uri)" ;; - "MATE"*) image="$(gsettings get org.mate.background picture-filename)" ;; - *) image="$(gsettings get org.gnome.desktop.background picture-uri)" ;; - esac + else + image="$(gsettings get org.gnome.desktop.background picture-uri)" + fi + ;; + esac - # Strip quotes etc from the path. - image="${image/'file://'}" - image="$(trim_quotes "$image")" - image="${image//\%20/ }" - fi + # Strip quotes etc from the path. + image="${image/'file://'}" + image="$(trim_quotes "$image")" + image="${image//\%20/ }" ;; "Mac OS X")