dotfiles

My collection of dotfiles
git clone git://git.noxz.tech/dotfiles
Log | Files | Refs

set-wallpaper (362B)


      1 #!/bin/sh
      2 
      3 STDIN="$(cat -)"
      4 
      5 [ ! -f "$STDIN" ] && exit 1
      6 
      7 case "$STDIN" in
      8 *.ff.gz)
      9 	cp "$STDIN" "$XDG_CONFIG_HOME/wallpaper.ff.gz"
     10 	;;
     11 *.png | *.jpg | *.jpeg | *.gif | *.bmp)
     12 	tmp="$(mktemp)"
     13 	convert "$STDIN" png:- | png2ff | gzip -c > "$tmp" && \
     14 	mv "$tmp" "$XDG_CONFIG_HOME/wallpaper.ff.gz"
     15 	;;
     16 *)
     17 	exit 1
     18 	;;
     19 esac
     20 
     21 swall "$XDG_CONFIG_HOME/wallpaper.ff.gz"