Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env macruby
- abort "Usage: #{__FILE__} [image]" if ARGV.empty?
- framework "Cocoa"
- wallpaper_path = File.expand_path(ARGV.first)
- wallpaper_url = NSURL.fileURLWithPath(wallpaper_path, isDirectory: false)
- workspace = NSWorkspace.sharedWorkspace
- NSScreen.screens.each do |screen|
- workspace.setDesktopImageURL(wallpaper_url, forScreen:screen, options:nil, error:nil)
- end
Add Comment
Please, Sign In to add comment