#!/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