Guest User

Untitled

a guest
Jan 21st, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #!/usr/bin/env macruby
  2.  
  3. abort "Usage: #{__FILE__} [image]" if ARGV.empty?
  4.  
  5. framework "Cocoa"
  6.  
  7. wallpaper_path = File.expand_path(ARGV.first)
  8. wallpaper_url = NSURL.fileURLWithPath(wallpaper_path, isDirectory: false)
  9. workspace = NSWorkspace.sharedWorkspace
  10.  
  11. NSScreen.screens.each do |screen|
  12. workspace.setDesktopImageURL(wallpaper_url, forScreen:screen, options:nil, error:nil)
  13. end
Add Comment
Please, Sign In to add comment