Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
randomly pick 2 images, combine them, and set it as desktop
#!/bin/sh
d="$HOME/wallpaper"
o=`mktemp`
c=`ls $d | grep -iE "(.jpg|.gif|.png)" | sort -R | head -2`
if [ $# -gt 0 ] ; then
a=$1
else
a=`echo $c | cut -d " " -f 1`
fi
if [ $# -gt 1 ] ; then
b=$2
else
b=`echo $c | cut -d " " -f 2`
fi
montage $d/$a $d/$b -tile 2x1 -geometry 1920x1080 $o
feh --bg-tile $o
rm $o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment