1
0
Fork 0

improve copy indicator

This commit is contained in:
Luca Bilke 2024-02-28 02:44:43 +01:00
parent c6fa749f0c
commit 5439c4af71

View file

@ -98,14 +98,20 @@ cmd paste &{{
mode="$1"
shift
case "$mode" in
copy)
rsync -aP --del -- "$@" . |
stdbuf -i0 -o0 -e0 tr '\r' '\n' |
while IFS= read -r line; do
lf -remote "send $id echo $line"
copy)
rsync -aP --del -- "$@" . &
i=0
while ps -p "$!" >/dev/null; do
i=$(((i + 1) % 3))
dots=""
for i in $(seq 0 $i); do
dots="${dots}."
done
;;
move) mv -n -- "$@" .;;
lf -remote "send $id echo 'Copying$dots'"
sleep 0.3
done
;;
move) mv -n -- "$@" . ;;
esac
rm ~/.local/share/lf/files
lf -remote "send clear"