Merge pull request #501 from dylanaraps/wallp
Wallpaper: Rewrite wallpaper functon.
This commit is contained in:
commit
234dddead4
1 changed files with 20 additions and 17 deletions
37
neofetch
37
neofetch
|
@ -2042,27 +2042,30 @@ get_w3m_img_path() {
|
||||||
get_wallpaper() {
|
get_wallpaper() {
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Linux" | "BSD")
|
"Linux" | "BSD")
|
||||||
if type -p feh >/dev/null && [[ -f "$HOME/.fehbg" ]]; then
|
# Get DE if user has disabled the function.
|
||||||
image="$(awk -F\' '/feh/ {printf $2}' "$HOME/.fehbg")"
|
[[ -z "$de" ]] && get_de
|
||||||
|
|
||||||
elif type -p nitrogen >/dev/null; then
|
case "$de" in
|
||||||
image="$(awk -F'=' '/file/ {printf $2;exit;}' "$XDG_CONFIG_HOME/nitrogen/bg-saved.cfg")"
|
"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
|
elif type -p nitrogen >/dev/null; then
|
||||||
# Get DE if user has disabled the function.
|
image="$(awk -F'=' '/file/ {printf $2;exit;}' "$XDG_CONFIG_HOME/nitrogen/bg-saved.cfg")"
|
||||||
[[ -z "$de" ]] && get_de
|
|
||||||
|
|
||||||
case "$de" in
|
else
|
||||||
"Cinnamon"*) image="$(gsettings get org.cinnamon.desktop.background picture-uri)" ;;
|
image="$(gsettings get org.gnome.desktop.background picture-uri)"
|
||||||
"MATE"*) image="$(gsettings get org.mate.background picture-filename)" ;;
|
fi
|
||||||
*) image="$(gsettings get org.gnome.desktop.background picture-uri)" ;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Strip quotes etc from the path.
|
# Strip quotes etc from the path.
|
||||||
image="${image/'file://'}"
|
image="${image/'file://'}"
|
||||||
image="$(trim_quotes "$image")"
|
image="$(trim_quotes "$image")"
|
||||||
image="${image//\%20/ }"
|
image="${image//\%20/ }"
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Mac OS X")
|
"Mac OS X")
|
||||||
|
|
Loading…
Reference in a new issue