Last active
August 29, 2015 14:03
-
-
Save youpy/59d39a509e7b38f9841c to your computer and use it in GitHub Desktop.
show image on iTerm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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