#!/bin/bash #set -x #Parameters#{{{ IMG_DIR="$HOME/Pictures" CONF_DIR="$HOME/.config/xfce4/xfconf/xfce-perchannel-xml" CONF_FILE="$CONF_DIR/xfce4-desktop" WALLPAPER_LIST="$IMG_DIR/images.txt" #}}} #Make the file list if empty#{{{ test -f $WALLPAPER_LIST || touch $WALLPAPER_LIST #}}} # Fill the file if it is empty {{{ CHECK_LIST () { if [ ! -s "$WALLPAPER_LIST" ] then # Put all the files in the file (yep Ashley is in there twice) for FILES in 1920x1200 processed 1600x1200 1600x1200/women/a/ashley_judd do find $IMG_DIR/$FILES -name "*.jpg" >> $WALLPAPER_LIST done #Randomize the order shuf $WALLPAPER_LIST -o $WALLPAPER_LIST.bak mv $WALLPAPER_LIST.bak $WALLPAPER_LIST fi } #}}} # New Image {{{ NEW_IMAGE () { FILE=`head -n 1 $WALLPAPER_LIST` grep $FILE -v $WALLPAPER_LIST > $WALLPAPER_LIST.bak mv $WALLPAPER_LIST.bak $WALLPAPER_LIST echo "# xfce backdrop list" > ${CONF_FILE}${COUNT}.xml echo $FILE >> ${CONF_FILE}${COUNT}.xml } #}}} #The script#{{{ for COUNT in `seq 1 2` #change 1 to number of screens do CHECK_LIST NEW_IMAGE done export DISPLAY=:0.1 && xfdesktop --reload #}}}