From 184f134c9e987447b40f5f01a05968bdb9adcf65 Mon Sep 17 00:00:00 2001 From: KlzXS Date: Sun, 13 Feb 2022 10:37:21 +0100 Subject: [PATCH] Respect NNN_TRASH in .nmv --- plugins/.nmv | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/.nmv b/plugins/.nmv index bf07b10f..fe747668 100755 --- a/plugins/.nmv +++ b/plugins/.nmv @@ -23,6 +23,15 @@ INCLUDE_HIDDEN="${INCLUDE_HIDDEN:-0}" VERBOSE="${VERBOSE:-0}" RECURSIVE="${RECURSIVE:-0}" +case "$NNN_TRASH" in + 1) + RM_UTIL="trash-put" ;; + 2) + RM_UTIL="gio trash" ;; + *) + RM_UTIL="rm -ri" ;; +esac + selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection} exit_status=0 @@ -164,7 +173,7 @@ done <"$dst_file" unset "items[0]" for item in "${items[@]}"; do - rm -ri "$item" + $RM_UTIL "$item" done rm "$dst_file"