From 1df0de7563d7c60085ec6838607003a71fcec8dc Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Thu, 16 Jan 2020 23:31:05 +1300 Subject: [PATCH] mail: add task2mutt and switch scripts to neomutt --- system/desktop/mail-stuff.nix | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/system/desktop/mail-stuff.nix b/system/desktop/mail-stuff.nix index e3e6db3..a3adcd7 100644 --- a/system/desktop/mail-stuff.nix +++ b/system/desktop/mail-stuff.nix @@ -476,10 +476,21 @@ in { macro pager U "+unread\n" macro pager u "-unread\n" + bind index l noop + bind pager l noop + macro index l "" # set tags manual + macro pager l "" # set tags manual + + # taskwarrior + # ----------- + # from https://www.nixternal.com/mark-e-mails-in-mutt-as-tasks-in-taskwarrior/ bind index t noop bind pager t noop - macro index t "" # set tags manual - macro pager t "" # set tags manual + bind index T noop + bind pager T noop + macro index T "${pkgs.writers.writeDash "mutt2task" '' + ${pkgs.taskwarrior}/bin/task add +email E-mail: $( ${pkgs.gnugrep}/bin/grep 'Subject' $* | awk -F: '{print $2}' ) + ''}" # top index bar in email view set pager_index_lines=7 @@ -507,21 +518,24 @@ in { environment.systemPackages = let - mailSync = pkgs.writeShellScriptBin "mail-sync" '' + mailSync = pkgs.writers.writeDashBin "mail-sync" '' ${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 ''; - mailView = pkgs.writeShellScriptBin "mail-view" '' - ${pkgs.alot}/bin/alot "$@" + mailView = pkgs.writers.writeDashBin "mail-view" '' + ${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 ${mailView}/bin/mail-view ${mailSend}/bin/mail-send ${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 ]; }