"COMPUTER POWER TO THE PEOPLE! DOWN WITH CYBERCRUD!" - Theodor Nelson
My StuffLoveRespectAdmiration
My AmpsLinksArchives
|
Sunday, March 13, 2005Fun Script Project
OK,
I decided to take a little break this weekend and do something that I've been wanting for a little while. What is it you might ask? Well, it seems rather dumb, but I like for my wallpaper to change. Now, when I was back in X Windows land, this was simple. Perl, crontab, and voila changing wallpapers. It seems to be more a challenge on windows. So, I dusted off google and found the solution. I implemented it in a quick and dirty little ruby script. All I did was put all of my images (already converted to bmp) into one directory and it cycles between them all. Nothing sexy really. I've just been curious on how to do this on windows. I have Squeak that changes my wallpaper of my current project. So, I wanted it all of the time. I'm a happy boy now. Here it is (like I said, it is ROUGH) require 'win32/registry' That's it! It's amazing how little information there is. I found changing the registry only by chance. And then, it will not update. Calling the rundll32 command by pure chance. It was a good learning experience and it makes me a little bit of a happier boy. One more note, I converted all of my jpg and gifs to bmp via Squeak. I couldn't find any conversion image stuff for Ruby. If anyone knows of any, let me know. Now, back to Fox/Ruby land for work on my Trail Blazer inspired tool...=) |
Comments
The most used graphic library in Ruby is probably RMagick, which is a binding to ImageMagick. Converting a file is also rather easy: http://studio.imagemagick.org/RMagick/doc/comtasks.html#convert
Enjoy Ruby :) If one day we could have Ruby's pragmatism and Smalltalk's IDE, we'd show those Java boys...
By Vincent Foley, at 10:30 AM