feat: neomutt auto open html emails in w3m

This commit is contained in:
Youwen Wu 2024-12-27 21:02:32 -08:00
parent c8700244d7
commit 3a6f88043e
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3
2 changed files with 19 additions and 1 deletions

View file

@ -1,4 +1,4 @@
{ config, ... }: { config, pkgs, ... }:
{ {
imports = [ imports = [
@ -44,4 +44,10 @@
}; };
addKeysToAgent = "yes"; addKeysToAgent = "yes";
}; };
# text/html; ~/.mutt/view_attachment.sh %s html; test=test -n "$DISPLAY"
home.file.".mailcap".text = ''
text/html; ${pkgs.w3m}/bin/w3m %s; nametemplate=%s.html; needsterminal
text/html; ${pkgs.w3m}/bin/w3m -v -F -T text/html -dump %s; copiousoutput
'';
} }

View file

@ -22,6 +22,12 @@ in
macro index,pager \cs "<pipe-message> ${pkgs.urlscan}/bin/urlscan<Enter>" "call urlscan to extract URLs out of a message" macro index,pager \cs "<pipe-message> ${pkgs.urlscan}/bin/urlscan<Enter>" "call urlscan to extract URLs out of a message"
macro attach,compose \cs "<pipe-entry> ${pkgs.urlscan}/bin/urlscan<Enter>" "call urlscan to extract URLs out of a message" macro attach,compose \cs "<pipe-entry> ${pkgs.urlscan}/bin/urlscan<Enter>" "call urlscan to extract URLs out of a message"
auto_view text/html
alternative_order text/enriched text/plain text/html text
bind index,pager V noop ## Unbinds V from version
macro index,pager V "<view-attachments><search>html<enter><view-mailcap><exit>"
''; '';
}; };
@ -99,4 +105,10 @@ in
--client-secret "''$(cat ${secrets.youwen_ucsb_client_secret.path})" --client-secret "''$(cat ${secrets.youwen_ucsb_client_secret.path})"
'') '')
]; ];
# text/html; ~/.mutt/view_attachment.sh %s html; test=test -n "$DISPLAY"
home.file.".mailcap".text = ''
text/html; ${pkgs.w3m}/bin/w3m %s; nametemplate=%s.html; needsterminal
text/html; ${pkgs.w3m}/bin/w3m -v -F -T text/html -dump %s; copiousoutput
'';
} }