Skip to content

Instantly share code, notes, and snippets.

@aont
Created November 6, 2010 11:48
Show Gist options
  • Save aont/665356 to your computer and use it in GitHub Desktop.
Save aont/665356 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
interval = 5
path = File::dirname(File.expand_path(__FILE__)) + "/"
Dir::chdir(path)
p path
while true
files = Dir::glob("*.bmp\0*.jpg\0*.jpeg\0*.png")
filename = files[rand(files.length)]
print filename , "\n"
system("gconftool -t string -s /desktop/gnome/background/picture_filename " + ( path + filename ).sub(" ","\\ "))
sleep interval * 60
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment