mirror of
https://github.com/jarun/nnn.git
synced 2024-09-28 16:57:50 +00:00
Merge plugins pastebin and upload
This commit is contained in:
parent
045ad3da75
commit
d43abec4bc
|
@ -40,7 +40,6 @@ Plugins extend the capabilities of `nnn`. They are _executable_ scripts (or bina
|
||||||
| nuke | Sample file opener (CLI-only by default) | sh | various |
|
| nuke | Sample file opener (CLI-only by default) | sh | various |
|
||||||
| oldbigfile | List large files by access time | sh | find, sort |
|
| oldbigfile | List large files by access time | sh | find, sort |
|
||||||
| organize | Auto-organize files in directories by file type | sh | file |
|
| organize | Auto-organize files in directories by file type | sh | file |
|
||||||
| pastebin | Paste contents of a text a file ix.io | sh | - |
|
|
||||||
| pdfread | Read a PDF or text file aloud | sh | pdftotext, mpv,<br>pico2wave |
|
| pdfread | Read a PDF or text file aloud | sh | pdftotext, mpv,<br>pico2wave |
|
||||||
| pdfview | View PDF file in `$PAGER` | sh | pdftotext/<br>mupdf-tools |
|
| pdfview | View PDF file in `$PAGER` | sh | pdftotext/<br>mupdf-tools |
|
||||||
| picker | Pick files and list one per line (to pipe) | sh | nnn |
|
| picker | Pick files and list one per line (to pipe) | sh | nnn |
|
||||||
|
@ -52,7 +51,7 @@ Plugins extend the capabilities of `nnn`. They are _executable_ scripts (or bina
|
||||||
| treeview | Informative tree output in `$EDITOR` | sh | tree |
|
| treeview | Informative tree output in `$EDITOR` | sh | tree |
|
||||||
| uidgid | List user and group of all files in dir | sh | ls, less |
|
| uidgid | List user and group of all files in dir | sh | ls, less |
|
||||||
| upgrade | Upgrade nnn manually on Debian 9 Stretch | sh | curl |
|
| upgrade | Upgrade nnn manually on Debian 9 Stretch | sh | curl |
|
||||||
| upload | Upload file to file.io | sh | curl, jq, tr |
|
| upload | Paste text to ix.io, upload binary to file.io | sh | curl, jq, tr |
|
||||||
| vidthumb | Show video thumbnails in terminal | sh | [ffmpegthumbnailer](https://github.com/dirkvdb/ffmpegthumbnailer),<br>[lsix](https://github.com/hackerb9/lsix) |
|
| vidthumb | Show video thumbnails in terminal | sh | [ffmpegthumbnailer](https://github.com/dirkvdb/ffmpegthumbnailer),<br>[lsix](https://github.com/hackerb9/lsix) |
|
||||||
| wall | Set wallpaper or change colorscheme | sh | nitrogen/pywal |
|
| wall | Set wallpaper or change colorscheme | sh | nitrogen/pywal |
|
||||||
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
# Description: Paste contents of a text a file http://ix.io
|
|
||||||
#
|
|
||||||
# Shell: POSIX compliant
|
|
||||||
# Author: Arun Prakash Jana
|
|
||||||
|
|
||||||
if ! [ -z "$1" ]; then
|
|
||||||
curl -F "f:1=@$1" ix.io
|
|
||||||
read -r _
|
|
||||||
fi
|
|
|
@ -1,19 +1,25 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
# Description: Upload a file to file.io
|
# Description: Paste contents of a text a file http://ix.io
|
||||||
|
# Upload a binary file to file.io
|
||||||
# Requires: curl, jq, tr
|
# Requires: curl, jq, tr
|
||||||
# Note: File set to expire after a week
|
# Note: Binary file set to expire after a week
|
||||||
#
|
#
|
||||||
# Shell: POSIX compliant
|
# Shell: POSIX compliant
|
||||||
# Author: Arun Prakash Jana
|
# Author: Arun Prakash Jana
|
||||||
|
|
||||||
if [ -s "$1" ]; then
|
if ! [ -z "$1" ] && [ -s "$1" ]; then
|
||||||
# Upload the file, show the download link and wait till user presses any key
|
if [ "$(mimetype --output-format %m "$1" | awk -F '/' '{print $1}')" = "text" ]; then
|
||||||
curl -s -F "file=@$1" https://file.io/?expires=1w | jq '.link' | tr -d '"'
|
curl -F "f:1=@$1" ix.io
|
||||||
|
else
|
||||||
|
# Upload the file, show the download link and wait till user presses any key
|
||||||
|
curl -s -F "file=@$1" https://file.io/?expires=1w | jq '.link' | tr -d '"'
|
||||||
|
|
||||||
# To write download link to "$1".loc and exit
|
# To write download link to "$1".loc and exit
|
||||||
# curl -s -F "file=@$1" https://file.io/?expires=1w -o `basename "$1"`.loc
|
# curl -s -F "file=@$1" https://file.io/?expires=1w -o `basename "$1"`.loc
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "empty file!"
|
printf "empty file!"
|
||||||
fi
|
fi
|
||||||
read -r _
|
|
||||||
|
read -r _
|
||||||
|
|
Loading…
Reference in a new issue