Create a gist now

Instantly share code, notes, and snippets.

A script that generates an XML file suitable for use by the Gnome Background Properties to change wallpapers.
files = []
puts "<background>
<starttime>
<year>2009</year>
<month>08</month>
<day>04</day>
<hour>00</hour>
<minute>00</minute>
<second>00</second>
</starttime>"
puts " <static>
<duration>1795.0</duration>
<file>#{ARGV[1]}</file>
</static>"
ARGV[2..-1].each_with_index do |filename, i|
puts " <transition>
<duration>5.0</duration>
<from>#{ARGV[i-1]}</from>
<to>#{filename}</to>
</transition>
<static>
<duration>1795.0</duration>
<file>#{filename}</file>
</static>"
end
puts " <transition>
<duration>5.0</duration>
<from>#{ARGV[-1]}</from>
<to>#{ARGV[1]}</to>
</transition>
</background>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment