Skip to content

Instantly share code, notes, and snippets.

@creature
Created April 20, 2014 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creature/11101265 to your computer and use it in GitHub Desktop.
Save creature/11101265 to your computer and use it in GitHub Desktop.
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