1
0
Fork 0

use rsync for paste, add 0x0 sharing keybind

This commit is contained in:
Luca Bilke 2022-07-31 13:15:03 +02:00
parent f6aea2caaa
commit 7d9d739924
1 changed files with 21 additions and 2 deletions

View File

@ -148,18 +148,37 @@ cmd on-cd &{{
lf -remote "send $id set promptfmt \"$fmt\""
}}
cmd paste $cp-p --lf-paste $id
cmd paste &{{
set -- $(cat ~/.local/share/lf/files)
mode="$1"
shift
case "$mode" in
copy)
rsync -av --ignore-existing --progress -- "$@" . |
stdbuf -i0 -o0 -e0 tr '\r' '\n' |
while IFS= read -r line; do
lf -remote "send $id echo $line"
done
;;
move) mv -n -- "$@" .;;
esac
rm ~/.local/share/lf/files
lf -remote "send clear"
}}
cmd share $curl -F"file=@$fx" https://0x0.snaile.de | xclip -selection c
# Bindings
map <c-f> $lf -remote "send $id select '$(fzf)'"
map J $lf -remote "send $id cd $(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)"
map D trash
# map D delete
map <c-d> delete
map E extract
map C copyto
map R rsyncto
map M moveto
map P link
map S share
map <c-n> push :mkdir<space>
map <c-r> reload