Skip to content

Instantly share code, notes, and snippets.

@youpy
Last active August 29, 2015 14:03
Show Gist options
  • Save youpy/59d39a509e7b38f9841c to your computer and use it in GitHub Desktop.
Save youpy/59d39a509e7b38f9841c to your computer and use it in GitHub Desktop.
show image on iTerm
def main
url = ARGV.shift
filename = '/tmp/image_on_iterm'
system('curl %s > %s 2>/dev/null' % [url, filename])
command =<<CMD % filename
osascript -e "
tell application \\"iTerm\\"
tell the first terminal
tell the last session
set background image path to \\"%s\\"
end tell
end tell
end tell
" 2>/dev/null
CMD
system(command)
end
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment