Skip to content

Instantly share code, notes, and snippets.

@chaoxu
Created March 12, 2011 07:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chaoxu/867123 to your computer and use it in GitHub Desktop.
Save chaoxu/867123 to your computer and use it in GitHub Desktop.
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