Last active
February 1, 2016 15:21
-
-
Save chmouel/05ffa97e0194b4d59e36 to your computer and use it in GitHub Desktop.
Upload directly to google drive the current screenshot, bind it to a keyboard shortcut (and pbcopy the output url) for ultimate effectiveness
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
#!/bin/bash | |
# Install gdrive: https://github.com/prasmussen/gdrive (in /usr/local/bin here) | |
# do a drive list and get a folder where you will upload the screenshot | |
gdrive_container="0B7bJ57bKfWfBY1RsMVF5OVA3TEk" | |
filename=$(date "+%F__%H-%M-%S-$RANDOM.png") | |
save_to="/tmp/$filename" | |
screencapture -i "$save_to" | |
if [[ -e "$save_to" ]]; then | |
url=$(/usr/local/bin/drive upload -p ${gdrive_container} --share -f ${save_to}|sed -n '/is now readable/ { s/.*@ //;p; }') | |
_surl=$(curl -s "http://is.gd/api.php?longurl=${url}") | |
echo $_surl | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Plugged to alfred like that, the Run script being this script :