From 2ad7b06ced0ffa39d20e6be41466e5bd834ee956 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Thu, 23 Jul 2026 00:56:24 +0530 Subject: feat(w3m): add module with desktop entry + integrate into neomutt - modules/web/w3m: enable/package options, desktop entry via kitty, assertion - modules/web/w3m: delegate to programs.w3m under the hood - modules/web/w3m: default package to programs.w3m.finalPackage - modules/desktop/xdg: add portal config with common.default = "*" - neomutt/nix: use lib.getExe' config.web.w3m.package for w3m refs - neomutt/assertions: add w3m dependency assertion - users/arpit: enable web.w3m --- modules/communication/neomutt/macros.nix | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'modules/communication/neomutt/macros.nix') diff --git a/modules/communication/neomutt/macros.nix b/modules/communication/neomutt/macros.nix index 0548a0f..87c05d1 100644 --- a/modules/communication/neomutt/macros.nix +++ b/modules/communication/neomutt/macros.nix @@ -11,13 +11,31 @@ action = "set my_wait_key=$wait_key wait_key=no${lib.getExe config.scripts.neomutt-sync.package}set wait_key=$my_wait_key"; } { - # gx: extract links from the current message and open one, vim-netrw style + # gx: open the message body in interactive w3m -- 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. map = [ "index" "pager" ]; key = "gx"; - action = "urlscan"; + action = "urlscan"; + } + { + # Ctrl-B in the pager: same interactive w3m 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"; + } + { + # 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"; } { map = [ @@ -32,7 +50,7 @@ # the counterpart to gf (interactive limit prompt) in binds.nix map = [ "index" ]; key = "gF"; - action = "~A"; + action = "all"; } { # ZZ: save and quit, vim-style (sync mailbox, then quit) -- cgit v1.2.3