Improve mail2task
This commit is contained in:
parent
1c5f397ede
commit
6535c07103
|
@ -1,7 +1,8 @@
|
||||||
{ pkgs, lib, config, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
let
|
let
|
||||||
quick-sync = pkgs.writeShellScript "quick-mail-and-todo-sync" ''
|
mail2task = pkgs.writeShellScript "mail2task" ''
|
||||||
${pkgs.isync}/bin/mbsync hera:INBOX,Code,Move/todo
|
set -euxo pipefail
|
||||||
|
${pkgs.isync}/bin/mbsync hera:Move/todo
|
||||||
${pkgs.fd}/bin/fd -tf . ${maildir}/hera/Move/todo | ${pkgs.mblaze}/bin/mscan -f "E-Mail from %f: %S" | xargs -I '{}' ${pkgs.taskwarrior}/bin/task add '"{}"'
|
${pkgs.fd}/bin/fd -tf . ${maildir}/hera/Move/todo | ${pkgs.mblaze}/bin/mscan -f "E-Mail from %f: %S" | xargs -I '{}' ${pkgs.taskwarrior}/bin/task add '"{}"'
|
||||||
${pkgs.mblaze}/bin/mlist ${maildir}/hera/Move/todo | ${pkgs.mblaze}/bin/mflag -S
|
${pkgs.mblaze}/bin/mlist ${maildir}/hera/Move/todo | ${pkgs.mblaze}/bin/mflag -S
|
||||||
${pkgs.mblaze}/bin/mlist ${maildir}/hera/Move/todo | ${pkgs.mblaze}/bin/mrefile ${unsorted}
|
${pkgs.mblaze}/bin/mlist ${maildir}/hera/Move/todo | ${pkgs.mblaze}/bin/mrefile ${unsorted}
|
||||||
|
@ -103,7 +104,7 @@ in
|
||||||
services.mbsync.postExec = "${sortMail}/bin/sort-mail-archive";
|
services.mbsync.postExec = "${sortMail}/bin/sort-mail-archive";
|
||||||
accounts.email.accounts = lib.mkIf pkgs.withSecrets {
|
accounts.email.accounts = lib.mkIf pkgs.withSecrets {
|
||||||
hera.imapnotify = {
|
hera.imapnotify = {
|
||||||
onNotify = lib.mkForce "${quick-sync}";
|
onNotifyPost = "${mail2task}";
|
||||||
boxes = [ "Move/todo" ];
|
boxes = [ "Move/todo" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue