Permalink
Browse files

Merge pull request #1 from asdf-chan/patch-1

PNG and GIF extensions need "*"
  • Loading branch information...
2 parents 5445a89 + 3f45a04 commit 7f736ec320331825e2405e96722fda78779a8373 @graysky2 committed Dec 30, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 backdrop-randomizer
View
@@ -80,7 +80,7 @@ check() {
# use only one find command to both test for pics and to generate pic_database
pic_database="$BD_DIR/backdrop-randomizer.list"
- [[ ! -f "$pic_database" ]] && find "${PIC_PATH}" -maxdepth "$MAXDEPTH" -name "*.jpg" -o -name "*.JPG" -o -name ".png" -o -name ".PNG" -o -name ".gif" -o -name ".GIF" > "$pic_database" 2>/dev/null
+ [[ ! -f "$pic_database" ]] && find "${PIC_PATH}" -maxdepth "$MAXDEPTH" -name "*.jpg" -o -name "*.JPG" -o -name "*.png" -o -name "*.PNG" -o -name "*.gif" -o -name "*.GIF" > "$pic_database" 2>/dev/null
howmany=$(cat "$pic_database" | wc -l)
@@ -123,7 +123,7 @@ list() {
}
cycle() {
- find "${PIC_PATH}" -maxdepth "$MAXDEPTH" -name "*.jpg" -o -name "*.JPG" -o -name ".png" -o -name ".PNG" -o -name ".gif" -o -name ".GIF" > "$pic_database" 2>/dev/null
+ find "${PIC_PATH}" -maxdepth "$MAXDEPTH" -name "*.jpg" -o -name "*.JPG" -o -name "*.png" -o -name "*.PNG" -o -name "*.gif" -o -name "*.GIF" > "$pic_database" 2>/dev/null
howmany=$(cat "$pic_database" | wc -l)
}
@@ -136,7 +136,7 @@ randomize() {
# condition 1 is true
useit=$(sed -n "1 p" "$pic_database") && filename=$(basename $useit)
- find "${PIC_PATH}" -maxdepth "$MAXDEPTH" -name "*.jpg" -o -name "*.JPG" -o -name ".png" -o -name ".PNG" -o -name ".gif" -o -name ".GIF" > "$pic_database"
+ find "${PIC_PATH}" -maxdepth "$MAXDEPTH" -name "*.jpg" -o -name "*.JPG" -o -name "*.png" -o -name "*.PNG" -o -name "*.gif" -o -name "*.GIF" > "$pic_database"
sed -i "/$filename/d" "$pic_database" # exclude the one we just picked to create the illusion that we NEVER repeat :)
ln -sf "$useit" "$SLINK_DIR"/backdrop-randomizer.jpg
[[ ! -z $(pidof xfdesktop) ]] && DISPLAY=:0.0 /usr/bin/xfdesktop --reload

0 comments on commit 7f736ec

Please sign in to comment.