Module: Hasselhoff
- Includes:
- Desktop
- Defined in:
- lib/hasselhoff.rb,
lib/hasselhoff/version.rb
Overview
Looking for freedom…
Constant Summary collapse
- VERSION =
'0.0.1'
Class Method Summary collapse
Class Method Details
.set_random_hoff ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/hasselhoff.rb', line 10 def set_random_hoff path = images.sample script = <<SCRIPT tell application "System Events" set theDesktops to a reference to every desktop repeat with i from 1 to (count theDesktops) set picture of item i of the theDesktops to "#{path}" end repeat end tell SCRIPT `osascript -e '#{script}'` #osx = OSX.new #image = HTTP.uri?(path) ? WebImage.new(path) : LocalImage.new(path) #osx.desktop_image = image end |