Skip to content

Instantly share code, notes, and snippets.

@morganp
Created July 16, 2010 15:48
Show Gist options
  • Save morganp/478513 to your computer and use it in GitHub Desktop.
Save morganp/478513 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
color = ['Cyan',
'Blue',
'DarkOrange',
'DarkSeaGreen',
'DarkSalmon',
'DeepPink',
'DimGray',
'Green',
'HotPink',
'DarkOrchid',
'Khaki',
'Lavender',
'DeepSkyBlue',
'FireBrick',
'GreenYellow',
'Gold',
'Ivory',
'HoneyDew',
'Tomato',
'Yellow',
'Plum',
'Pink',
'Peru',
'RoyalBlue',
'SpringGreen',
'Tan',
'MistyRose'
]
if ARGV.size > 0
open("| export DISPLAY=#{ARGV[0]}")
else
puts "No Args"
end
(0...150).each do |x|
x_off = rand(2500)
y_off = rand(1500)
width = rand(175) + 50
bcolor = rand(color.size)
delay = rand(1000)
dig = 0 #rand(1)
geom = " -geometry #{width}x#{(width*1.1).to_i}+#{x_off}+#{y_off}"
if dig == 1
open("| xclock -digital #{geom} -bg #{color[bcolor]} &")
else
open("| xclock -analog #{geom} -bg #{color[bcolor]} &")
end
sleep(delay/1000)
end
sleep(10)
open("| killall xclock")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment