dotfiles/.bin/documents-next
2023-12-12 08:39:33 +01:00

31 lines
558 B
Plaintext
Executable File

#/bin/sh -xe
. ${HOME}/.bin/_config
needs pdfarranger--
cd ${PIMDIR}/documents
_doc=$(ls -1 _incoming | head -1)
if [ -z "$_doc" ]
then
echo "Nothing left... wohooo!"
exit 0
fi
pdfarranger "_incoming/${_doc}" > /dev/null 2>&1 &
echo "Here is: ${_doc}"
echo "Shall we move it to _done? [y = yes, yn = yes and next]"
read key
again=0
case $key in
[yY]) mv "_incoming/${_doc}" done/; ;;
[yY][nN]) mv "_incoming/${_doc}" done/; again=1; ;;
*) echo "What a shame..."; ;;
esac
pkill -f /usr/local/bin/pdfarranger
[ $again -eq 1 ] && $0