- Download the file
- Open up the terminal
chmod +x imgpbcopy
- (optional) Move the script to a folder that is in your PATH (
echo $PATH
to see the folders). a. Can also add to your PATH a~/bin/
folder like so:PATH=~/bin:$PATH
in your.bashrc
or.zshrc
file. - In the terminal you can now do:
imgpbcopy https://zapier.com/brand/assets/images/logos/zapier-logo.png
- Try in Slack, Google Docs, Jira, or Quip!
Created
June 20, 2018 15:43
-
-
Save ibolmo/c08973f5d4534ae2ff13f38e02f9e286 to your computer and use it in GitHub Desktop.
Copy an image (from URL) into your clipboard
This file contains 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
#!/bin/bash | |
tmp_image_file="$TMPDIR.imgpbcopy.png" | |
curl $1 > $tmp_image_file | |
osascript -e "set the clipboard to (read (POSIX file \"$tmp_image_file\") as JPEG picture)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment