From c4e395ccaaac33b1898d447b09377b8e3fd9cfa3 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Tue, 10 Sep 2024 17:59:56 +0530 Subject: Refactor newsboat config to nix --- modules/newsboat.home/config.nix | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 modules/newsboat.home/config.nix (limited to 'modules/newsboat.home/config.nix') diff --git a/modules/newsboat.home/config.nix b/modules/newsboat.home/config.nix new file mode 100644 index 0000000..2669482 --- /dev/null +++ b/modules/newsboat.home/config.nix @@ -0,0 +1,49 @@ +rec { + config = { + reload-threads = 6; + max-items = 20; + browser = "~/.config/newsboat/opener.sh '%t' %u"; + show-keymap-hint = false; + refresh-on-startup = true; + save-path = "~/Downloads/articles"; + articlelist-format = "%?T?| %-26T | %5i: ?%t"; + prepopulate-query-feeds = true; + }; + + keys = { + j = "down"; + k = "up"; + l = "open"; + h = "quit"; + g = "home"; + G = "end"; + q = "hard-quit"; + n = "next"; + p = "prev"; + }; + + macros = let + copyCmd = "~/.config/newsboat/opener.sh copy %u"; + in { + y = ''set browser "${copyCmd}"; open-in-browser; set browser "${config.browser}"''; + }; + + extraConfig = '' +color background color223 default +color listnormal color246 default +color listnormal_unread color62 default bold +color listfocus white magenta +color listfocus_unread white magenta bold underline +color info color8 default +color article white default + +highlight article "^(Feed|Link|Title|Date|Author):.*$" color223 default bold +highlight article "\\[[0-9]+\\]" color62 default bold +highlight article "https?://[^ ]+" color117 default underline +highlight article "\\[image\\ [0-9]+\\]" color117 default bold +highlight articlelist "\\|[^|]*\\|" color253 default bold +highlight articlelist "\\| \\[yt\\][^|]*\\|" color1 default bold +highlight articlelist "\\| r/[^|]*\\|" color253 default +highlight articlelist "\\| VimTricks[^|]*\\|" color27 default + ''; +} -- cgit v1.3.1