Skip to content

Commit

Permalink
Respect NNN_TRASH in .nmv
Browse files Browse the repository at this point in the history
  • Loading branch information
KlzXS committed Feb 13, 2022
1 parent 23b54ba commit 184f134
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion plugins/.nmv
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 184f134

Please sign in to comment.