aurora13428ef
lf: delete with a y/N prompt instead of trashing
+2 −15
1 file changed
- M .config/lf/lfrc +2 −15
| @@ -56,19 +56,7 @@ cmd extract ${{ | |||
| 56 | 56 | [ "$ans" = "y" ] && ext $fx | |
| 57 | 57 | }} | |
| 58 | 58 | ||
| 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) | |
| 72 | 60 | cmd delete ${{ | |
| 73 | 61 | clear; tput cup $(($(tput lines)/3)); tput bold | |
| 74 | 62 | set -f | |
| @@ -107,9 +95,8 @@ on-cd | |||
| 107 | 95 | ||
| 108 | 96 | # Bindings | |
| 109 | 97 | map <c-f> fzf-jump | |
| 110 | − | map D trash | |
| 98 | + | map D delete | |
| 111 | 99 | map <delete> delete | |
| 112 | − | map U restore | |
| 113 | 100 | map p paste | |
| 114 | 101 | map dd cut | |
| 115 | 102 | map M transfer move | |