mail: add task2mutt and switch scripts to neomutt

This commit is contained in:
Ingolf Wagner 2020-01-16 23:31:05 +13:00
parent d81e29de50
commit 1df0de7563
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B

View file

@ -476,10 +476,21 @@ in {
macro pager U "<modify-labels>+unread\n" macro pager U "<modify-labels>+unread\n"
macro pager u "<modify-labels>-unread\n" macro pager u "<modify-labels>-unread\n"
bind index l noop
bind pager l noop
macro index l "<modify-labels>" # set tags manual
macro pager l "<modify-labels>" # set tags manual
# taskwarrior
# -----------
# from https://www.nixternal.com/mark-e-mails-in-mutt-as-tasks-in-taskwarrior/
bind index t noop bind index t noop
bind pager t noop bind pager t noop
macro index t "<modify-labels>" # set tags manual bind index T noop
macro pager t "<modify-labels>" # set tags manual bind pager T noop
macro index T "<pipe-message>${pkgs.writers.writeDash "mutt2task" ''
${pkgs.taskwarrior}/bin/task add +email E-mail: $( ${pkgs.gnugrep}/bin/grep 'Subject' $* | awk -F: '{print $2}' )
''}<enter>"
# top index bar in email view # top index bar in email view
set pager_index_lines=7 set pager_index_lines=7
@ -507,21 +518,24 @@ in {
environment.systemPackages = let environment.systemPackages = let
mailSync = pkgs.writeShellScriptBin "mail-sync" '' mailSync = pkgs.writers.writeDashBin "mail-sync" ''
${pkgs.muchsync}/bin/muchsync mailfetcher@workhorse.private --nonew ${pkgs.muchsync}/bin/muchsync mailfetcher@workhorse.private --nonew
''; '';
mailSend = pkgs.writeShellScriptBin "mail-send" '' mailSend = pkgs.writers.writeDashBin "mail-send" ''
${pkgs.msmtp}/bin/msmtp-queue -r ${pkgs.msmtp}/bin/msmtp-queue -r
''; '';
mailView = pkgs.writeShellScriptBin "mail-view" '' mailView = pkgs.writers.writeDashBin "mail-view" ''
${pkgs.alot}/bin/alot "$@" ${pkgs.neomutt}/bin/neomutt"$@"
''; '';
mail = pkgs.writeShellScriptBin "mail" '' mutt = pkgs.writers.writeDashBin "mutt" ''
${pkgs.neomutt}/bin/neomutt"$@"
'';
mail = pkgs.writers.writeDashBin "mail" ''
${mailSync}/bin/mail-sync ${mailSync}/bin/mail-sync
${mailView}/bin/mail-view ${mailView}/bin/mail-view
${mailSend}/bin/mail-send ${mailSend}/bin/mail-send
${mailSync}/bin/mail-sync ${mailSync}/bin/mail-sync
''; '';
in [ pkgs.notmuch pkgs.alot pkgs.muchsync mail mailSync mailView mailSend pkgs.neomutt ]; in [ pkgs.notmuch pkgs.alot pkgs.muchsync mail mailSync mailView mailSend pkgs.neomutt mutt ];
} }