all repos — dotfiles @ b3cf48f70b54896e5137dc4e545317fd5f3cc13c

my *nix dotfiles

bin/up (view raw)

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