[phpBB Debug] PHP Notice: in file /viewtopic.php on line 981: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 981: getdate(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
Tynsoe Projects • View topic - Using the image geeklet

Using the image geeklet

Using the image geeklet

Postby sinecure » Tue Mar 23, 2010 11:19 pm

I'm attempting to use the image geeklet to randomly show one of *any* of my photos in a section of the desktop. I've found, however, that the image geeklet does not recursively look at the path location you select, but only looks at image files in that folder.

For example, assume the following directory structure.

Code: Select all
/Pictures
/Pictures/1
/Pictures/2
/Pictures/3


If I select /Picture, I would expect any picture in /Picture, /Picture/1, /Picture/2, or /Picture/3 to be shown. However, only pictures in /Picture are shown.

Can someone confirm whether this behavior is intentional? If so, I may need to start code diving. ;)
sinecure
 
Posts: 4
Joined: Tue Mar 23, 2010 11:07 pm

Re: Using the image geeklet

Postby JasonDax » Fri Apr 02, 2010 5:21 am

It seems like it's coded that way: I have the same problem too. I want to display a random picture from an extense album, ordered by folders.

So, I use a small code to random pick a picture from all directories, copy that random image to another location, an set GeekTool to display that specific image. A bit rough, but do the job.

If that serve your purpose, i share the code here:

Code: Select all
find -E ~/Wallpapers -iregex ".*.jpg"|
(
        i=0; while read line; do lines[i++]="$line"; done
        cp "${lines[$RANDOM % $i]}" ~/Wallpapers/_RandomImage/random.jpg
)


Save it with the name you like, in the location you want. I use "gt-randomimage.s". Remember to give rwx permision to that file. Ah, and replace "Wallpapers" with your image directory, and "_RandomImage/random.jpg" with the location and the name you pick for that.

Hope this help you.
JasonDax
 
Posts: 1
Joined: Fri Apr 02, 2010 5:10 am

Re: Using the image geeklet

Postby sinecure » Sat Apr 03, 2010 3:36 pm

Thanks for the idea! I ended up using a similar solution. Instead of picking a random image I made links to all my images in a directory, then let GeekTool pick a random image from those.

I'll include the script below just in case anyone else looks for this.

Code: Select all
cd ~/Pictures/Links

# Remove all broken symbolic links - originals have been removed.
find . -type l -print0 \
   | xargs -0 file \
   | grep "broken symbolic" \
   | sed -e 's/^/"/' -e 's/: *broken symbolic.*$/"/' \
   | xargs rm

# Add any pictures not already present in this directory.
find -E ~/Pictures/Photos -iregex ".*\.(jpg|png|bmp|gif)" -not -path "*.picasaoriginals*" -print0 \
   | while read -d $'\0' file
   do
      slink=`echo -n "$file" | /sbin/md5``basename "${file// /_}"`
      if test ! -L "$slink"
      then
         ln -s "$file" "$slink"
      fi
   done


Each link's file name is prefixed with the md5 hash of the entire path of the original file to prevent collisions.

EDIT: I forgot to mention I run this once per hour using cron, but anything which would run it at a regular interval would work.
sinecure
 
Posts: 4
Joined: Tue Mar 23, 2010 11:07 pm

Re: Using the image geeklet

Postby ybizeul » Sun Apr 25, 2010 7:46 pm

Guys, you'll be glad to know that since build 128, GeekTool now picks random images recursively into the whole directory.
ybizeul
Site Admin
 
Posts: 133
Joined: Fri Jan 22, 2010 4:34 pm

Re: Using the image geeklet

Postby sinecure » Mon May 10, 2010 8:11 pm

Thank you!
sinecure
 
Posts: 4
Joined: Tue Mar 23, 2010 11:07 pm

Re: Using the image geeklet

Postby streftr » Fri Sep 17, 2010 11:12 pm

is anyone else having issues with the image geeklet on osx 10.6.4? my img's don't refresh. idk if its a bug or what. any help would be appreciated it. all my other geeklets work just fine. i have a weather geeklet with an image and temp and those work fine. idk if its relevant but im pointing the geeklet to an external HD which is where my aperture lib is located. i tried setting the path to the local disk and the geeklet still does not refresh.
streftr
 
Posts: 2
Joined: Fri Sep 17, 2010 10:08 pm

Re: Using the image geeklet

Postby sinecure » Sat Sep 18, 2010 4:05 am

Not having any trouble here.
sinecure
 
Posts: 4
Joined: Tue Mar 23, 2010 11:07 pm

Re: Using the image geeklet

Postby ybizeul » Sat Sep 18, 2010 7:33 am

streftr wrote:is anyone else having issues with the image geeklet on osx 10.6.4? my img's don't refresh. idk if its a bug or what. any help would be appreciated it. all my other geeklets work just fine. i have a weather geeklet with an image and temp and those work fine. idk if its relevant but im pointing the geeklet to an external HD which is where my aperture lib is located. i tried setting the path to the local disk and the geeklet still does not refresh.


What build are you using ? This issue has been solved in build 128, not in a RC
ybizeul
Site Admin
 
Posts: 133
Joined: Fri Jan 22, 2010 4:34 pm

Re: Using the image geeklet

Postby streftr » Wed Sep 22, 2010 1:42 pm

I DL the latest one from this forum. it says 3.0(12A) still no luck i reinstalled Geektool and i'm having no luck! any help?

update: i found the problem. i was selecting the path for my img from the photos tab that comes up, and i was manually picking the 1st img. when i pointed the path to the aperture lib without actually picking the 1st img it now refreshes and selects diff img from that directory. thanks for your help.
streftr
 
Posts: 2
Joined: Fri Sep 17, 2010 10:08 pm


Return to GeekTool

Who is online

Users browsing this forum: No registered users and 6 guests

cron