Krolyxon
Commit 13428ef

Branches

Refs →

aurora13428ef

lf: delete with a y/N prompt instead of trashing

Author
krolyxon
Date
2026-11-07 13:37 +0530
Parent
e70f5a5
Commit
13428ef935b2ce2d44d00370b5147c723df7f223

+2 −15

1 file changed

  1. M .config/lf/lfrc +2 −15
M .config/lf/lfrc View
@@ -56,19 +56,7 @@ cmd extract ${{
5656 [ "$ans" = "y" ] && ext $fx
5757 }}
5858
59−# D: to the trash (gio, restorable with U); <delete>: gone for good
60−cmd trash %{{
61− set -f
62− gio trash -- $fx
63− lf -remote "send $id :unselect; echo trashed $(printf '%s\n' "$fx" | wc -l) item(s), U restores"
64−}}
65−
66−cmd restore ${{
67− pick=$(gio trash --list | awk -F '\t' '{ print $2 "\t" $1 }' |
68− fzf --multi --delimiter '\t' --with-nth 1 --prompt "restore: ") || exit 0
69− printf '%s\n' "$pick" | cut -f2 | while read -r uri; do gio trash --restore "$uri"; done
70−}}
71−
59+# D / <delete>: gone for good, after a y/N prompt (no trash: /tmp etc. have none)
7260 cmd delete ${{
7361 clear; tput cup $(($(tput lines)/3)); tput bold
7462 set -f
@@ -107,9 +95,8 @@ on-cd
10795
10896 # Bindings
10997 map <c-f> fzf-jump
110−map D trash
98+map D delete
11199 map <delete> delete
112−map U restore
113100 map p paste
114101 map dd cut
115102 map M transfer move