Image 01
profile-image

Sbskl

S├ębastien Groult
CONKY-colors

Conky by helmuthdu 931 comments

conkyPhotoRandom don't support subdir and space in dirname. For picture conversion, I found a different way...

I modified conkyPhotoRandom like this :
Quote:
#!/bin/bash
#
# Photo in conky
# by helmuthdu and paulvictor
source="/home/sbskl/Images/Beautiful things"
photo=/tmp/conkyPhoto.png

cd "$source"
number=$(find . -iname *.jpg | wc -l)
random=$RANDOM
random=${random}%${number}
lines=`echo ${random} + 2 | bc`
filename=`find . -iname *.jpg | head -n $lines | tail -n 1`

convert "$filename" -gravity center -resize 360x360^ -extent 360x360 -bordercolor snow -background black -polaroid 0 $photo
convert $photo -resize 180x180 -gravity center -background none -extent 180x180 $photo

exit 0


The picture conversion is more simple and made always a squared picture of 180x180.

The first convert line can be change by :
Quote:
convert "$filename" -resize 360x360 -bordercolor snow -background black -polaroid 0 $photo


As you want...

But conky-color.c must be changed for support the new picture size.

Thanks for your good job and sorry for my poor english, I'm french ;o) - Jul 27 2010
8.2
Jul 27 2010