Created
August 25, 2018 11:28
-
-
Save s3krit/3273bcbf5fe1cf3a9d40a4682bd64739 to your computer and use it in GitHub Desktop.
Takes a screenshot and uploads it to file0, then shoves the URL in your clipboard. Requires scrot and beep.
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 | |
pushd /tmp | |
scrot "$@" scr.png | |
ret=$(curl -sfX POST -F 'files[]'="@scr.png" "https://file0.s3kr.it/upload") | |
filehash=$(echo $ret | egrep -o '[a-z0-9]{12}\.[a-z]{3}' | head -n 1) | |
desturl="https://file0.s3kr.it/${filehash}" | |
echo $desturl | tr -d '\n' | xclip -selection clipboard | |
echo $desturl | tr -d '\n' | xclip | |
rm scr.png | |
beep | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment