Posted by hank, Tue Jan 01 17:18:00 UTC 2008
Displaying articles with tag wallpaper
Posted by hank, Sun Aug 19 00:30:00 UTC 2007
I happened to find this today and thought it would make a nice wallpaper. I converted it into a 1600x1200 image. Here it is:
Tags: wallpaper
Posted by hank, Mon Jul 23 20:00:00 UTC 2007
I wanted a program that let me blend random wallpapers from a directory together and set them every minute with increasing opacity on one image, and then to select a new random image and repeat the process. I did this using RMagick and some Ruby.
Make the following tree:
~/.wallmold/
current.yml
Fill current.yml with this:
---
file2: someimage
wallpaperdir: wallpaper directory
dissolution: 0.1
file1: anotherimage
Replacing the image names and directory with the proper stuffs, full path on directory and relative on image names. Here’s mine:
---
file2: w09.jpg
wallpaperdir: /home/hank/MyDocs/Wallpapers
dissolution: 0.8
file1: Looking_Forward.jpg
Then, get this, make it executable, and put it somewhere:
#!/usr/bin/env ruby
# Wallmold - a wallpaper melding script
require 'RMagick'
require 'yaml'
class Array
def randomize
arr=self.dup
arr.collect { arr.slice!(rand(arr.length)) }
end
def randomize!
arr=self.dup
result = arr.collect { arr.slice!(rand(arr.length)) }
self.replace result
end
end
# Load State
configpath = "#{ENV['HOME']}/.wallmold/current.yml"
configfile = File.open(configpath, 'r')
config = YAML.load(configfile)
out = "#{ENV['HOME']}/.wallmold/dissolve.jpg"
# Open the Wallpaper directory
dir = Dir.open(config['wallpaperdir'])
newconfig = config
if config['dissolution'] == 0.9
# Get new images
files = dir.to_a.randomize
newconfig['file1'] = config['file2']
newconfig['file2'] = files.pop
newconfig['dissolution'] = 0.1
else
newconfig['file1'] = config['file1']
newconfig['file2'] = config['file2']
newconfig['dissolution'] = config['dissolution'] + 0.1
end
bgnd = Magick::Image.read(dir.path+"/"+newconfig['file1']).first
overlay = Magick::Image.read(dir.path+"/"+newconfig['file2']).first
# Make the first image is the same size as the second
bgnd.crop_resized!(overlay.columns, overlay.rows)
composited = bgnd.dissolve(overlay, newconfig['dissolution'])
composited.write(out)
`fbsetbg #{out}`
# Write new config
configfile.close
configfile = File.open(configpath, 'w')
configfile.puts newconfig.to_yaml
Now, just edit your crontab:
* * * * * DISPLAY=:0 ruby -r rubygems /home/hank/bin/wallmold.rb > /dev/null 2>&1
Tags: wallpaper
About Me
I'm a computer programmer from Ellicott City, MD.
I go to OSCON every year, write random code, and blag about it here.
I enjoy cooking,
reviewing beer, hiking, kayaking, and watching movies and television shows.
Email me: ralree@gmail.com
Blog Posts
Recent Beerings
Recently in wallpaper
Tags
america annoyances apache apple art bash beer blog books c camping comcast computers dns election 2008 encryption england finance firefox fix flash food fun funny games google gpg greasemonkey guide gutsy hacking hardware hosting howto humor images internet irc irssi javascript lame laptop life linux LOLCODE mephisto money mongrel music mysql networking news open source oscon osx pain perl pictures plugins politics programming rails religion ron paul rss ruby scripting security shopping site5 solution sql stocks subversion sysadmin theme tutorial typo ubuntu video vim voting wallpaper web design wibbish windows xorg _why


