Skip to content

Commit

Permalink
fixes in the photo script
Browse files Browse the repository at this point in the history
  • Loading branch information
helmuthdu committed Jan 16, 2013
1 parent 30b159f commit 4aa152c
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 44 deletions.
55 changes: 33 additions & 22 deletions conkycolors/bin/conkyPhoto
Expand Up @@ -8,7 +8,7 @@ template="/usr/share/conkycolors/icons"
filename="/usr/share/backgrounds/159.jpg"

#choose your theme: 1,2 or 3
theme=1
theme=3

dim="medium"
# Manage dimension flag
Expand All @@ -23,27 +23,38 @@ elif [[ $dim == "big" ]]; then
geometry_crop="396x312"
fi

cp "$filename" "$photo"
rm ${photo}
cp ${filename} ${photo}

convert "$filename" -resize $geometry\> -size $geometry xc:black +swap -gravity center -composite "$photo"
if [[ -f ${photo} ]]; then
convert ${filename} -resize ${geometry}\> \
-size ${geometry} xc:black +swap \
-gravity center -composite ${photo}

if [[ $theme -eq 1 ]]; then
# Theme 1
convert -page +2+2 "$photo"\
-bordercolor snow -border 4.5\
-bordercolor gray55 -border 1 \
-background black \( +clone -shadow 40x2+1+1 \) +swap \
-background none -flatten \
"$photo"
elif [[ $theme -eq 2 ]]; then
# Theme 2
convert -page +4+4 "$photo"\
-bordercolor gray10 -border 1\
-background black \( +clone -shadow 40x4+2+2 \) +swap \
-background none -flatten \
"$photo"
elif [[ $theme -eq 3 ]]; then
# Theme 3
convert "$template"/photobg_bg_$dim.png "$photo" -geometry +11+11 -composite "$photo"
convert "$photo" "$template"/photobg_shadow_$dim.png -composite "$photo"
if [[ $theme -eq 1 ]]; then
# Theme 1
convert -page +2+2 ${photo} \
-bordercolor snow -border 4.5 \
-bordercolor gray55 -border 1 \
-background black \( +clone -shadow 40x2+1+1 \) +swap \
-background none -flatten \
${photo}
elif [[ $theme -eq 2 ]]; then
# Theme 2
convert -page +4+4 ${photo} \
-bordercolor gray10 -border 1 \
-background black \( +clone -shadow 40x4+2+2 \) +swap \
-background none -flatten \
${photo}
elif [[ $theme -eq 3 ]]; then
# Theme 3
convert ${template}/photobg_bg_${dim}.png ${photo} \
-geometry +11+11 -composite ${photo}
convert ${photo} ${template}/photobg_shadow_${dim}.png \
-composite ${photo}
fi
else
cp ${imagenotfound} ${photo}
fi

exit
54 changes: 32 additions & 22 deletions conkycolors/bin/conkyPhotoRandom
Expand Up @@ -6,7 +6,7 @@
source="/usr/share/backgrounds/"
photo="/tmp/conkyPhoto.png"
template="/usr/share/conkycolors/icons/ConkyPhoto"
filename=`find $source -type f | shuf -n1`
filename=`find $source \( -iname "*.png" -o -iname "*.jpg" \) | shuf -n1`

#choose your theme: 1,2 or 3
theme=3
Expand All @@ -24,28 +24,38 @@ elif [[ $dim == "big" ]]; then
geometry_crop="396x312"
fi

cp "$filename" "$photo"
rm ${photo}
cp ${filename} ${photo}

convert "$filename" -resize $geometry\> -size $geometry xc:black +swap -gravity center -composite "$photo"
convert ${filename} -resize ${geometry}\> \
-size ${geometry} xc:black +swap \
-gravity center -composite ${photo}

if [[ $theme -eq 1 ]]; then
# Theme 1
convert -page +2+2 "$photo"\
-bordercolor snow -border 4.5\
-bordercolor gray55 -border 1 \
-background black \( +clone -shadow 40x2+1+1 \) +swap \
-background none -flatten \
"$photo"
elif [[ $theme -eq 2 ]]; then
# Theme 2
convert -page +4+4 "$photo"\
-bordercolor gray10 -border 1\
-background black \( +clone -shadow 40x4+2+2 \) +swap \
-background none -flatten \
"$photo"
elif [[ $theme -eq 3 ]]; then
# Theme 3
convert "$template"/photobg_bg_$dim.png "$photo" -geometry +11+11 -composite "$photo"
convert "$photo" "$template"/photobg_shadow_$dim.png -composite "$photo"
if [[ -f ${photo} ]]; then
if [[ $theme -eq 1 ]]; then
# Theme 1
convert -page +2+2 ${photo} \
-bordercolor snow -border 4.5 \
-bordercolor gray55 -border 1 \
-background black \( +clone -shadow 40x2+1+1 \) +swap \
-background none -flatten \
${photo}
elif [[ $theme -eq 2 ]]; then
# Theme 2
convert -page +4+4 ${photo} \
-bordercolor gray10 -border 1 \
-background black \( +clone -shadow 40x4+2+2 \) +swap \
-background none -flatten \
${photo}
elif [[ $theme -eq 3 ]]; then
# Theme 3
convert ${template}/photobg_bg_${dim}.png ${photo} \
-geometry +11+11 -composite ${photo}
convert ${photo} ${template}/photobg_shadow_${dim}.png \
-composite ${photo}
fi
else
cp ${imagenotfound} ${photo}
fi

exit
File renamed without changes

0 comments on commit 4aa152c

Please sign in to comment.