diff options
| author | 2019-11-02 02:24:14 +0100 | |
|---|---|---|
| committer | 2019-11-02 06:54:14 +0530 | |
| commit | 3c1645ca904578a7c43ed8e8e7e264cf99f997da (patch) | |
| tree | 96d10efbee412d944f5adb8db446cc2403d03860 /plugins/drop-file | |
| parent | 013dad11868df0b389d5ccc87943678abe0bf83e (diff) | |
| download | nnn-3c1645ca904578a7c43ed8e8e7e264cf99f997da.tar.gz | |
Merged drag and drop scripts to 1 file (#372)
Diffstat (limited to 'plugins/drop-file')
| -rwxr-xr-x | plugins/drop-file | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/plugins/drop-file b/plugins/drop-file deleted file mode 100755 index f43cde1..0000000 --- a/plugins/drop-file +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env sh - -# Description: Provides drag and drop window for files. -# -# Files that are dropped will be added to nnn's selection -# Some web based files will be downloaded to current directory with curl -# and it may overwrite some existing files -# -# The user has to press mm to clear nnn's selection first -# -# Dependency: https://github.com/mwh/dragon -# Shell: POSIX compliant -# Author: 0xACE - -selection=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection - -dnd() -{ - if which dragon-drag-and-drop; then - dragon-drag-and-drop "$@" - else - dragon "$@" - fi -} - -function add_file() { - echo -n "$@" >> "$selection" - echo -ne "\0" >> "$selection" -} - -echo -n > "$selection" - -# which dnd -# upstream calls it dragon - -dnd --print-path --target | while read f -do - if echo -n "$f" | grep '^\(https\?\|ftps\?\|s\?ftp\):\/\/' ; then - curl -LJO "$f" - add_file "$PWD/$(basename "$f")" - elif [ -e "$f" ]; then - add_file "$f" - fi -done & |