diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2019-03-24 17:38:29 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2019-03-24 17:40:15 +0530 |
commit | f135a30c0c95b84eb62b157f6ff454866b250fce (patch) | |
tree | 995620c128a529e3bd52e5b1b5cded8840a0f199 /user-scripts | |
parent | 0328eafcb9cff7b90963b4dd7d2bfae6eca0cbd7 (diff) | |
download | nnn-f135a30c0c95b84eb62b157f6ff454866b250fce.tar.gz |
Add script to upload a file to transfer.sh
Diffstat (limited to 'user-scripts')
-rw-r--r-- | user-scripts/README.md | 1 | ||||
-rwxr-xr-x | user-scripts/imgresize | 2 | ||||
-rwxr-xr-x | user-scripts/transfer | 16 |
3 files changed, 18 insertions, 1 deletions
diff --git a/user-scripts/README.md b/user-scripts/README.md index 1bfcbd4..cbed784 100644 --- a/user-scripts/README.md +++ b/user-scripts/README.md @@ -13,4 +13,5 @@ | nlaunch | Drop-down independent app launcher (needs fzy), drop in `$PATH`; fallback regular prompt | | picker | Pick files and pipe the newline-separated list to another utility | | sxiv | Open images in current directory in sxiv | +| transfer | Upload current file to transfer.sh | | upgrade | Check and update to latest version of nnn manually on Debian 9 Stretch | diff --git a/user-scripts/imgresize b/user-scripts/imgresize index 40b9945..6d016f1 100755 --- a/user-scripts/imgresize +++ b/user-scripts/imgresize @@ -25,7 +25,7 @@ if [ -z "$res" ]; then read res fi -if [ -z "$res" ]; then +if ! [ -z "$res" ]; then if ! [ -z "$minsize" ]; then imgp -ackx "$res" -s "$minsize" fi diff --git a/user-scripts/transfer b/user-scripts/transfer new file mode 100755 index 0000000..7201b0b --- /dev/null +++ b/user-scripts/transfer @@ -0,0 +1,16 @@ +#!/usr/bin/env sh + +# Description: Upload a file to transfer.sh +# +# Shell: POSIX compliant +# Author: Arun Prakash Jana + +if ! [ -z "$1" ]; then + # Upload the file, show the download link and wait till user presses any key + curl -s --upload-file "$1" https://transfer.sh/`basename "$1"` + echo + read input + + # To write download link to "$1".loc and exit + # curl -s --upload-file "$1" https://transfer.sh/`basename "$1"` -o `basename "$1"`.loc +fi |