From f1af023403abfa2c7494795c55b296f5bdea231b Mon Sep 17 00:00:00 2001 From: Thomas Dehaeze Date: Tue, 3 Nov 2020 11:41:39 +0100 Subject: [PATCH] Add a way to drag and drop files for attachment --- dotfiles/mail.org | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/dotfiles/mail.org b/dotfiles/mail.org index 6fa0af3..1d0190d 100644 --- a/dotfiles/mail.org +++ b/dotfiles/mail.org @@ -340,7 +340,7 @@ https://marlam.de/msmtp/ Useful commands are described in the [[http://www.djcbsoftware.nl/code/mu/cheatsheet.html][Cheat-sheet]]. For instance, to find mails with =pdf= attachments: -#+begin_src bash :eval no +#+begin_src bash :eval no :tangle no mu find 'mime:application/pdf' #+end_src @@ -352,7 +352,7 @@ For instance, to find mails with =pdf= attachments: https://neomutt.org/ Documentation: -#+begin_src bash :results none :exports code +#+begin_src bash :results none :exports code :tangle no man neomutt man neomuttrc #+end_src @@ -790,6 +790,11 @@ Attach multiple files using ranger macro compose A "bash $HOME/.config/neomutt/bin/rangerpicksource /tmp/rangerpickbash $HOME/.config/neomutt/bin/rangerpick clean" "Attach with Ranger" #+end_src +Attach file by drooping from GUI +#+begin_src conf + macro compose B "bash $HOME/.config/neomutt/bin/rangerpick dragonsource /tmp/rangerpickbash $HOME/.config/neomutt/bin/rangerpick clean" "Attach with Ranger" +#+end_src + **** Attach with Ranger Script :PROPERTIES: :header-args: :tangle ~/.config/neomutt/bin/rangerpick @@ -799,9 +804,11 @@ Attach multiple files using ranger #+begin_src bash tmpfile=/tmp/rangerpick if [ -z "$1" ]; then - ranger --choosefiles $tmpfile && sed -i 's/\s/\\ /g' $tmpfile && echo "$(awk 'BEGIN {printf "%s", "push "} {printf "%s", ""$0""}' $tmpfile)" > $tmpfile + ranger --choosefiles $tmpfile && sed -i 's/\s/\\ /g' $tmpfile && echo "$(awk 'BEGIN {printf "%s", "push "} {printf "%s", ""$0""}' $tmpfile)" > $tmpfile + elif [ $1 == "dragon" ]; then + dragon-drag-and-drop --target --print-path --keep > $tmpfile && sed -i 's/\s/\\ /g' $tmpfile && echo "$(awk 'BEGIN {printf "%s", "push "} {printf "%s", ""$0""}' $tmpfile)" > $tmpfile elif [ $1 == "clean" ]; then - ls $tmpfile + ls $tmpfile fi #+end_src @@ -1207,7 +1214,7 @@ This empty code block is used to add a new line after signature set use_from # respect the From: address the editor sends back # Use Vim to compose email, with a few default options. - set editor = "nvim -c '/\\n--' -c ':noh' -c 'startinsert' -c ':Goyo'" + set editor = "nvim -c '/\\n--' -c ':noh' -c 'startinsert'" #+END_SRC ** View Options @@ -1247,7 +1254,6 @@ This empty code block is used to add a new line after signature *** Compose View Options #+BEGIN_SRC conf - set envelope_from # which from? set sig_dashes # dashes before sig set sig_on_top # the signature is just below the response set edit_headers # show headers when composing @@ -1322,8 +1328,7 @@ This empty code block is used to add a new line after signature set mail_check_stats # Display the Sidebar mailboxes using this format string. - # set sidebar_format = '%B %?N?(%N)?%* %S' - set sidebar_format = '%B %* %?N?[%N]?' + set sidebar_format = '%D %* %?N?[%N]?' # Sort the mailboxes in the Sidebar using this method: # count - total number of messages