Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixes in the photo script

  • Loading branch information...
commit 4aa152c5c9ba4c6770ee7214be409c17ed3a90d4 1 parent 30b159f
@helmuthdu authored
View
55 conkycolors/bin/conkyPhoto
@@ -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
@@ -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
View
54 conkycolors/bin/conkyPhotoRandom
@@ -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
@@ -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
View
0  svg/ConkyColorsWeather.svg → svg/conkycolorsweather.svg
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.