Skip to content

Commit

Permalink
Catch missing wind-dir in random mode
Browse files Browse the repository at this point in the history
  • Loading branch information
onli committed Feb 16, 2015
1 parent d160055 commit e4a8f7d
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions izulu
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ setWallpaper() {
fi
fi
current="$specific"

if [ "$RANDOMLY" == "TRUE" ] && [[ -z "$random_override" ]];then
random_image=$(cycleWallpaper "$specific" "$generic")
if [[ -n "$random_image" ]];then
Expand Down Expand Up @@ -410,31 +410,33 @@ osdNotify() {
cycleWallpaper() {
local specific="$1"
local generic="$2"
local randomdir=""

case "$generic" in
"gen_sun")
RANDOMDIR="$RANDOMSUNDIR"
randomdir="$RANDOMSUNDIR"
;;
"gen_cloud")
RANDOMDIR="$RANDOMCLOUDDIR"
randomdir="$RANDOMCLOUDDIR"
;;
"gen_rain")
RANDOMDIR="$RANDOMRAINDIR"
randomdir="$RANDOMRAINDIR"
;;
"gen_snow")
RANDOMDIR="$RANDOMSNOWDIR"
randomdir="$RANDOMSNOWDIR"
;;
"gen_misc")
RANDOMDIR="$RANDOMMISCDIR"
*)
randomdir="$RANDOMMISCDIR"
;;
esac

if [[ -z "$RANDOMDIR" ]];then
if [[ -z "$randomdir" ]];then
setWallpaper "$specific" "$generic" "TRUE"
return 1
fi
fi

local pictures=()
for picture in "$RANDOMDIR"/*;do
for picture in "$randomdir"/*;do
pictures+=("$picture")
done
local chosen=$RANDOM
Expand Down

0 comments on commit e4a8f7d

Please sign in to comment.