From 929e2d330b5feefd7ec738bcf826f9e743834ec3 Mon Sep 17 00:00:00 2001 From: Niklas Date: Wed, 17 Jun 2020 21:23:07 +0200 Subject: [PATCH] added del pic script --- .local/share/scripts/del-pic.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 .local/share/scripts/del-pic.sh diff --git a/.local/share/scripts/del-pic.sh b/.local/share/scripts/del-pic.sh new file mode 100755 index 0000000..32f310f --- /dev/null +++ b/.local/share/scripts/del-pic.sh @@ -0,0 +1,18 @@ +#/usr/bin/env sh +set -e + +DIR=${1:-$("pwd")} +SELECT=$(sxiv -N "floatme" -t -o "$DIR") + +[[ -z "$SELECT" ]] && exit 0 + +COUNT=$(echo "$SELECT" | wc -l) + +read -p "Remove these $COUNT item(s)? " -n 1 -r +if [[ $REPLY =~ ^[Yy]$ ]] +then + while read -r line; do + rm $line + done <<< "$SELECT" +fi +