about summary refs log tree commit diff stats
path: root/modules
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-02-03 00:02:50 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-02-03 00:02:50 +0100
commit4219e03b8483b164d28bf60dde2356ebf66e9dd6 (patch)
treee5f2b0d926fcc7913a415299aab688012657173d /modules
parentfix(modules/lf/commands/trash_{clear,restore}): Use full path to file (diff)
downloadnixos-config-4219e03b8483b164d28bf60dde2356ebf66e9dd6.zip
fix(modules/lf/commands/trash_{clear,restore}): Don't start trash's interactive mode
When no files have been selected, trashy's trash client will start an
"interactive" mode and prompt for the files _again_. This should
obviously be avoided.
Diffstat (limited to 'modules')
-rwxr-xr-xmodules/by-name/lf/lf/commands/scripts/trash_clear.sh2
-rwxr-xr-xmodules/by-name/lf/lf/commands/scripts/trash_restore.sh2
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/by-name/lf/lf/commands/scripts/trash_clear.sh b/modules/by-name/lf/lf/commands/scripts/trash_clear.sh
index e3c2f795..faa3c553 100755
--- a/modules/by-name/lf/lf/commands/scripts/trash_clear.sh
+++ b/modules/by-name/lf/lf/commands/scripts/trash_clear.sh
@@ -4,6 +4,6 @@ while read -r file; do
     set -- "$@" "$(pwd)/$file"
 done <"$(conceal list | fzf --multi --ansi | awk '{for(i=3; i<=NF; i++) {print $i}}' | tmp)"
 
-trash empty --match=exact "$@"
+[ "$#" -ne 0 ] && trash empty --match=exact "$@"
 
 # vim: ft=sh
diff --git a/modules/by-name/lf/lf/commands/scripts/trash_restore.sh b/modules/by-name/lf/lf/commands/scripts/trash_restore.sh
index aa9ca0dc..f685345f 100755
--- a/modules/by-name/lf/lf/commands/scripts/trash_restore.sh
+++ b/modules/by-name/lf/lf/commands/scripts/trash_restore.sh
@@ -13,5 +13,5 @@ while read -r file; do
     set -- "$@" "$(pwd)/$file"
 done <"$(conceal list | fzf --multi --ansi | awk '{for(i=3; i<=NF; i++) {print $i}}' | tmp)"
 
-trash restore --match=exact "$@"
+[ "$#" -ne 0 ] && trash restore --match=exact "$@"
 # vim: ft=sh