all repos — dotfiles @ 5425e8c42b8fbef94dc04159b4b8e6cce636c466

my *nix dotfiles

home/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    case "$OSTYPE" in
 8        darwin*)
 9            printf "$out" | pbcopy
10            ;;
11        *)
12            printf "$out" | xclip -sel c
13            ;;
14    esac
15    printf "$out\n"
16}
17
18if [ "$1" == "l" ]; then
19    upload "$LATEST_SCROT"
20elif [ "$1" != "l" ]; then
21   upload "$1"
22fi