dotfiles/.config/neomutt/scripts/filepicker
2025-09-21 17:34:27 +02:00

11 lines
304 B
Bash
Executable file

#!/bin/sh
tmpfile=$HOME/.config/neomutt/tmpfile
if \[ -z "$1" \]; then
yazi --chooser-file $tmpfile &&
sed -i 's/ /^V /g' $tmpfile &&
echo "$(awk 'BEGIN {printf "%s", "push "} {printf "%s", "<attach-file>\""$0"\"<enter>"}' $tmpfile)" >$tmpfile
elif \[ $1 == "clean" \]; then
rm $tmpfile
fi