From 6910400bb38bb69a9e81b932b01fa51802cb0c47 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Sun, 26 Jul 2026 23:28:11 +0530 Subject: feat: replace w3m with chawan for HTML rendering and web browsing - Create web.chawan module with enable/package options, kitty desktop entry, and programs.chawan.settings (buffer.images=true, display.image-mode=auto) - Update neomutt macros, mailcap, and assertions from w3m to chawan - Switch waybar window-rewrite and workspace icon from W3M to Chawan - Drop web/w3m module --- modules/communication/neomutt/.neomuttrc | 3 ++- modules/communication/neomutt/assertions.nix | 8 ++++---- modules/communication/neomutt/macros.nix | 8 ++++---- modules/communication/neomutt/neomutt.nix | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) (limited to 'modules/communication') diff --git a/modules/communication/neomutt/.neomuttrc b/modules/communication/neomutt/.neomuttrc index 877e265..34d5a8e 100644 --- a/modules/communication/neomutt/.neomuttrc +++ b/modules/communication/neomutt/.neomuttrc @@ -12,7 +12,8 @@ set abort_key = "" # attachments: use our mailcap for dedicated openers, # and auto-render html/images inline where sensible set mailcap_path = "~/.config/neomutt/mailcap" -auto_view text/html image/png image/jpeg image/gif application/pdf +auto_view text/plain +alternative_order text/html image/png image/jpeg image/gif application/pdf # Nerd Font icon-based flag/attachment/crypto indicators # order: new, old, deleted, flagged, replied, old(unused), tagged, encrypt, ... diff --git a/modules/communication/neomutt/assertions.nix b/modules/communication/neomutt/assertions.nix index c4ce62a..5fad5c9 100644 --- a/modules/communication/neomutt/assertions.nix +++ b/modules/communication/neomutt/assertions.nix @@ -1,4 +1,4 @@ -# Assertions - Validates neomutt dependencies (less, bat, kitty, w3m) are enabled +# Assertions - Validates neomutt dependencies (less, bat, kitty, chawan) are enabled { config, ... }: { assertions = [ @@ -24,10 +24,10 @@ ''; } { - assertion = !config.communication.neomutt.enable || config.web.w3m.enable; + assertion = !config.communication.neomutt.enable || config.web.chawan.enable; message = '' - communication.neomutt is enabled but web.w3m.enable is not. - neomutt uses w3m for HTML email rendering. Please enable web.w3m. + communication.neomutt is enabled but web.chawan.enable is not. + neomutt uses chawan for HTML email rendering. Please enable web.chawan. ''; } ]; diff --git a/modules/communication/neomutt/macros.nix b/modules/communication/neomutt/macros.nix index bc18e43..d8b6f55 100644 --- a/modules/communication/neomutt/macros.nix +++ b/modules/communication/neomutt/macros.nix @@ -11,7 +11,7 @@ action = "set my_wait_key=$wait_key wait_key=no${lib.getExe config.scripts.neomutt-sync.package}set wait_key=$my_wait_key"; } { - # gx: open the message body in interactive w3m -- real vim-style + # gx: open the message body in interactive chawan -- real vim-style # cursor navigation (hjkl, Tab/Shift-Tab between links, Enter to # follow, B back, q to return to neomutt). Replaces the old # urlscan-based link picker. @@ -23,19 +23,19 @@ action = "urlscan"; } { - # Ctrl-B in the pager: same interactive w3m view as gx, kept as + # Ctrl-B in the pager: same interactive chawan view as gx, kept as # a second binding since Ctrl-B is a common muscle-memory key # for "open this in a browser-like view". map = [ "pager" ]; key = "\\Cb"; - action = "set my_pipe_decode=$pipe_decode pipe_decode=yes${lib.getExe' config.web.w3m.package "w3m"} -T text/htmlset pipe_decode=$my_pipe_decode"; + action = "set my_pipe_decode=$pipe_decode pipe_decode=yes${lib.getExe config.web.chawan.package} -T text/htmlset pipe_decode=$my_pipe_decode"; } { # Ctrl-B on a specific attachment (not just the top-level # message): pipe-entry sends the selected attachment instead. map = [ "attach" ]; key = "\\Cb"; - action = "${lib.getExe' config.web.w3m.package "w3m"} -cols 100 -T text/html"; + action = "${lib.getExe config.web.chawan.package} -cols 100 -T text/html"; } { # gF: clear the current limit/filter and show every message again, diff --git a/modules/communication/neomutt/neomutt.nix b/modules/communication/neomutt/neomutt.nix index 792f90e..623c3dd 100644 --- a/modules/communication/neomutt/neomutt.nix +++ b/modules/communication/neomutt/neomutt.nix @@ -18,7 +18,7 @@ "x-scheme-handler/mailto" = "neomutt.desktop"; }; xdg.configFile."neomutt/mailcap".text = '' - text/html; ${lib.getExe' config.web.w3m.package "w3m"} -dump -cols 100 -T text/html '%s'; copiousoutput; nametemplate=%s.html + text/html; ${lib.getExe config.web.chawan.package} '%s'; nametemplate=%s.html image/*; xdg-open '%s' & application/pdf; xdg-open '%s'; nametemplate=%s.pdf video/*; xdg-open '%s' & -- cgit v1.2.3