wallblur (1179B)
1 #!/bin/sh 2 # 3 # wallblur 4 # Created by Hayden Hamilton 5 # 6 # hayden@haydenvh.com 7 8 cache=$HOME/general/cache/ 9 10 backend="xwallpaper" 11 args=$(echo "$@" | sed 's/--force//g;s/force//g') 12 echo "$args" 13 14 donorm(){ 15 [ "$args" = "" ] && { 16 convert $file -sparse-color Barycentric '0,0 black 0,%h white' -function polynomial 3.5,-3.2,1.15 /tmp/blurmap.png 17 convert $file /tmp/blurmap.png -compose Blur -set option:compose:args 7 -composite $1 18 } || { 19 convert $file $args $1 20 } 21 files="$files $1" 22 } 23 input=$(cat $XDG_CACHE_HOME/rfeh/prev) 24 count=0 25 files="" 26 mkdir -p $cache/wallblur/ 27 28 for file in $input 29 do 30 count=$(($count+1)) 31 [ "$(echo "$@" | grep "force")" = "" ] && { 32 [ -f $cache/wallblur/$(basename $file) ] && { 33 files="$files $cache/wallblur/$(basename $file)" 34 } || { 35 donorm "$cache/wallblur/$(basename $file)" 36 } 37 } || { 38 donorm "$cache/wallblur/$(basename $file)" 39 } 40 41 done 42 43 files=$(echo "$files" | sed 's~[[:space:]]*$~~g;s~^[[:space:]]*~~g;s~//~/~g' | tr " " "\n" | sed "s~^~--output OUTPUT --zoom ~g" | tr "\n" " ") 44 echo $files 45 for OUTPUT in $(xrandr --listactivemonitors | awk '$4 {print $4}') 46 do 47 files=$(echo "$files" | sed "s/OUTPUT/$OUTPUT/") 48 done 49 xwallpaper $files