From bfdcb2e2ea48cf13a83ecb00fe614dbb7dd0b1d6 Mon Sep 17 00:00:00 2001 From: Luca Bilke <bilke@tralios.de> Date: Fri, 9 Feb 2024 16:30:15 +0100 Subject: [PATCH] make trash-prune less noisy on missing perms --- .local/libexec/cron/trash-prune | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.local/libexec/cron/trash-prune b/.local/libexec/cron/trash-prune index 29f9a9c3..924b9d9b 100755 --- a/.local/libexec/cron/trash-prune +++ b/.local/libexec/cron/trash-prune @@ -12,14 +12,17 @@ getfsroot() { list_trash_dirs() { for mnt in $(findmnt -Py -t "$types"); do - eval $mnt + eval "$mnt" + # shellcheck disable=2153 if [ "$TARGET" = "$(getfsroot "${XDG_DATA_HOME:-$HOME/.local/share}")" ]; then - echo "${XDG_DATA_HOME:-$HOME/.local/share}/Trash" + target=${XDG_DATA_HOME:-$HOME/.local/share}/Trash elif [ "$TARGET" = "/" ]; then - echo "/.Trash" + target=/.Trash else - echo "${TARGET}/.Trash" + target=${TARGET}/.Trash fi + [ -w "$target" ] && { echo "$target"; return; } + echo done }