bin/up (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
#!/usr/bin/env bash
LATEST_SCROT="$HOME/pics/scrots/latest.png"
upload() {
out="$(curl -s -F "file=@$1" -F "key=$(pw -s fsrv)" https://x.icyphox.sh)"
case "$OSTYPE" in
darwin*)
printf "$out" | pbcopy
;;
*)
printf "$out" | xclip -sel c
;;
esac
printf "$out\n"
}
if [ "$1" == "l" ]; then
upload "$LATEST_SCROT"
elif [ "$1" != "l" ]; then
upload "$1"
fi
|