]> Sergey Matveev's repositories - nnn.git/commitdiff
plugin: verbosepaste: gives copy-paste verbose progress percentage (#914)
authorBenawi Adha <43810055+wustho@users.noreply.github.com>
Wed, 24 Mar 2021 12:09:08 +0000 (19:09 +0700)
committerGitHub <noreply@github.com>
Wed, 24 Mar 2021 12:09:08 +0000 (17:39 +0530)
* plugin: verbosepaste: gives copy-paste verbose progress percentage

* plugin: verbosepaste: gives copy-paste verbose progress percentage

plugins/README.md
plugins/rsynccp [new file with mode: 0755]

index fdb0295b1d39a6cf66ec75f0fcc885737e463bbe..8a37b796c15d7a1b50739651dbe4387ab110d0f2 100644 (file)
@@ -68,6 +68,7 @@ Plugins extend the capabilities of `nnn`. They are _executable_ scripts (or bina
 | [uidgid](uidgid) | List user and group of all files in dir | sh | ls, less |
 | [upgrade](upgrade) | Upgrade nnn manually on Debian 9 Stretch | sh | curl |
 | [upload](upload) | Upload to Firefox Send or ix.io (text) or file.io (bin) | sh | [ffsend](https://github.com/timvisee/ffsend), curl, jq, tr |
+| [rsynccp](rsynccp) | Gives copy-paste verbose progress percentage | sh | rsync |
 | [vidthumb](vidthumb) | Show video thumbnails in terminal | sh | [ffmpegthumbnailer](https://github.com/dirkvdb/ffmpegthumbnailer),<br>[lsix](https://github.com/hackerb9/lsix) |
 | [wall](wall) | Set wallpaper or change colorscheme | sh | nitrogen/pywal |
 | [x2sel](x2sel) | Copy `\n`-separated file list from system clipboard to sel | sh | _see in-file docs_ |
diff --git a/plugins/rsynccp b/plugins/rsynccp
new file mode 100755 (executable)
index 0000000..60ee10c
--- /dev/null
@@ -0,0 +1,21 @@
+#!/usr/bin/env sh
+
+# Description: Simple script to give copy-paste a progress percentage
+#              by utilizing rsync.
+#
+#              LIMITATION: this won't work when pasting to MTP device.
+#
+# Dependencies: rsync
+#
+# Shell: POSIX compliant
+# Author: Benawi Adha
+
+sel=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
+
+# Choose one of these two schemes by commenting
+
+# more verbose
+xargs -0 -a "$sel" -I % rsync -ah --progress % "$PWD"
+
+# less verbose
+# xargs -0 -a "$sel" -I % rsync -ah --info=progress2 % "$PWD"