From b4ddb358d8f32a4a29f058114642d9e47005af72 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Thu, 2 May 2024 19:43:30 +0200 Subject: [PATCH] use new trash tool --- .config/lf/lfrc | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index e0b95d677..120b5aaab 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -27,12 +27,23 @@ cmd open-with ${{ }} cmd trash &{{ - for f in $fx; do - trash-put $f & - done + trash-cli put $fx lf -remote "send load" }} +cmd trash-restore ${{ + fileid=$( + trash-cli list "$PWD" | + fzf -d '\0' \ + --with-nth=1 \ + --nth=1 \ + --preview='printf "Original path: %s\nInfo path: %s\nTrashed on: %s\n" {1} {2} {3}' | + cut -d '' -f 2 + ) + [ -z "$fileid" ] && exit + trash-cli restore $fileid +}} + cmd lazygit %{{ dir=$(dirname "$(realpath "${f:-_}")"}) if ! git --noglob-pathspecs -C $dir status >/dev/null 2>&1; then @@ -280,7 +291,7 @@ map st :set sortby time; set info time map sa :set sortby atime; set info atime map sc :set sortby ctime; set info ctime map se :set sortby ext; set info -map $trash-restore $PWD +map trash-restore map t tag-toggle map T trash map u :clear; unselect