diff --git a/dotfiles/mail.org b/dotfiles/mail.org index 3951524..a85729a 100644 --- a/dotfiles/mail.org +++ b/dotfiles/mail.org @@ -687,9 +687,9 @@ Labels bind compose a attach-file #+END_SRC -Attach file using GUI File Manager +Attach multiple files using ranger #+begin_src conf - # macro compose A "bash $HOME/.config/neomut/bin/attach-file.shsource /tmp/muttpick" "Attach with GUI" + macro compose A "bash $HOME/.config/neomutt/bin/rangerpicksource /tmp/rangerpickbash $HOME/.config/neomutt/bin/rangerpick clean" "Attach with Ranger" #+end_src Write html emails using markdown @@ -702,6 +702,21 @@ Open another instance of neomutt in readonly mode while composing macro compose M "termite -e \"neomutt -R\"" #+END_SRC +**** Attach with Ranger Script + :PROPERTIES: + :header-args: :tangle ~/.config/neomutt/bin/rangerpick + :header-args+: :comments both :mkdirp yes + :header-args+: :shebang "#!/usr/bin/env bash" + :END: +#+begin_src bash + tmpfile=/tmp/rangerpick + if [ -z "$1" ]; then + ranger --choosefiles $tmpfile && sed -i 's/^//' $tmpfile && sed -i 's/$//' $tmpfile && sed -i ':a;N;$!ba;s/\n//g' $tmpfile && sed -i 's/^/push /' $tmpfile + elif [ $1 == "clean" ]; then + rm $tmpfile + fi +#+end_src + *** Browser #+begin_src conf bind browser l select-entry @@ -1184,7 +1199,7 @@ First, tag the files you want to send using =t=, then =;= to apply the action on :END: #+begin_src bash if [ "$1" = "all" ]; then - arg='all' + arg='-a' else arg='' fi