dotfiles-remastered/.local/share/scripts/del-pic.sh

19 lines
292 B
Bash
Raw Normal View History

2020-06-17 19:23:07 +00:00
#/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