aboutsummaryrefslogtreecommitdiffstats
path: root/home/newsboat/default.nix
blob: c95b95a6196d33f4a2afaf20cb4de2b26ea72f70 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
  vars,
  config,
  pkgs,
  ...
}:

{
  xdg.configFile."/home/petri/.config/newsboat/urls".text = ''
    "query:Unread Articles:unread = \"yes\""
  '';

  programs.newsboat = {
    enable = true;
    autoReload = true;
    browser = "\"${pkgs.chawan}/bin/cha %u\"";
    reloadTime = 2;
    extraConfig = ''
      # special
      macro o set browser "rdrview -T title,body -B cha %u" ; open-in-browser ; set browser "cha %u"

      # download
      prepopulate-query-feeds yes
      download-full-page yes
      urls-source "miniflux"
      miniflux-url "https://flux.tammi.cc"
      miniflux-tokenfile ${config.age.secrets.miniflux_api_key.path}

      # operation
      goto-next-feed no
      miniflux-show-special-feeds "no"
      feed-sort-order unreadarticlecount-asc
      article-sort-order date-asc

      # keys
      bind-key j down
      bind-key k up
      bind-key j next articlelist
      bind-key k prev articlelist
      bind-key J next-feed articlelist
      bind-key K prev-feed articlelist
      bind-key G end
      bind-key g home
      bind-key d pagedown
      bind-key u pageup
      bind-key l open
      bind-key h quit
      bind-key a toggle-article-read
      bind-key n next-unread
      bind-key N prev-unread
      bind-key D pb-download
      bind-key U show-urls
      bind-key x pb-delete
      bind-key o open-in-browser

      include ${pkgs.newsboat}/share/doc/newsboat/contrib/colorschemes/solarized-dark
    '';
  };
}