Skip to content

Instantly share code, notes, and snippets.

@s3krit
Created October 18, 2018 15:53
Show Gist options
  • Save s3krit/09b9935d0939b8d53f62718693a82397 to your computer and use it in GitHub Desktop.
Save s3krit/09b9935d0939b8d53f62718693a82397 to your computer and use it in GitHub Desktop.
#!/bin/bash
pushd /tmp > /dev/null
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 > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment