From 6d77ae412326007bf35f415ba8d55d5cee4a5bbc Mon Sep 17 00:00:00 2001 From: dylan araps Date: Tue, 5 Jan 2016 18:19:38 +1100 Subject: [PATCH] Added support for Windows wallpapers --- fetch.sh | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/fetch.sh b/fetch.sh index 3bffbf07..16ee8794 100755 --- a/fetch.sh +++ b/fetch.sh @@ -586,7 +586,6 @@ getresolution () { resolution="Unknown" ;; esac - } getcols () { @@ -613,6 +612,24 @@ getcols () { # Images {{{ +getwallpaper () { + case "$os" in + "Linux") + img=$(awk '/feh/ {printf $3}' "$HOME/.fehbg") + img=${img#\'*} + img=${img%*\'} + ;; + + "Windows"*) + img="%AppData%/Microsoft/Windows/Themes/TranscodedWallpaper.jpg" + ;; + + *) + wall="off" + ;; + esac +} + getimage () { # Check if the directory exists [ ! -d "$imgtempdir" ] && (mkdir "$imgtempdir" || exit) @@ -634,11 +651,7 @@ getimage () { esac # If wall=on, Get image to display from current wallpaper. - if [ "$wall" == "on" ]; then - img=$(awk '/feh/ {printf $3}' "$HOME/.fehbg") - img=${img#\'*} - img=${img%*\'} - fi + [ "$wall" == "on" ] && getwallpaper # Get name of image and prefix it with it's crop mode and offset imgname="$crop_mode-$crop_offset-${img##*/}"