This commit is contained in:
commit
95a533c876
451 changed files with 18255 additions and 0 deletions
47
modules/home/hyprland/applications/newsboat/default.nix
Normal file
47
modules/home/hyprland/applications/newsboat/default.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.wayland.windowManager.hyprland;
|
||||
app = cfg.applications.rssreader.default;
|
||||
reloadTime = "${toString config.programs.newsboat.reloadTime}";
|
||||
newsboat-reload = (import ./newsboat-reload.nix { inherit config pkgs; });
|
||||
|
||||
inherit (lib) mkIf;
|
||||
in
|
||||
{
|
||||
config = mkIf (cfg.enable && app == "newsboat") {
|
||||
programs.newsboat = {
|
||||
enable = true;
|
||||
extraConfig = builtins.readFile ./extra-config;
|
||||
};
|
||||
|
||||
home.packages = [ newsboat-reload ]; # newsboat's waybar module executes newsboat-reload on click
|
||||
|
||||
# Automatically reload newsboat on timer
|
||||
systemd.user = {
|
||||
timers.newsboat-reload = {
|
||||
Unit.Description = "Reload newsboat every ${reloadTime} minutes";
|
||||
|
||||
Timer.OnBootSec = "10sec";
|
||||
Timer.OnUnitActiveSec = "${reloadTime}min";
|
||||
Timer.Unit = "newsboat-reload.service";
|
||||
|
||||
Install.WantedBy = [ "timers.target" ];
|
||||
};
|
||||
|
||||
services.newsboat-reload = {
|
||||
Unit.Description = "Reload newsboat";
|
||||
|
||||
Service.Type = "oneshot";
|
||||
Service.ExecStart = "${newsboat-reload}/bin/newsboat-reload";
|
||||
|
||||
Install.WantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
35
modules/home/hyprland/applications/newsboat/extra-config
Normal file
35
modules/home/hyprland/applications/newsboat/extra-config
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
# Format
|
||||
feedlist-title-format "Your feeds (%u unread, %t total)%?T? - tag ‘%T’&?"
|
||||
articlelist-title-format "Articles in feed %T (%u unread, %t total) - %U"
|
||||
searchresult-title-format "Search result (%u unread, %t total)"
|
||||
filebrowser-title-format "%?O?Open File&Save File? - %f"
|
||||
help-title-format "Help"
|
||||
selecttag-title-format "Select Tag"
|
||||
selectfilter-title-format "Select Filter"
|
||||
itemview-title-format "%T (%u unread, %t total) "
|
||||
urlview-title-format "URLs"
|
||||
dialogs-title-format "Dialogs"
|
||||
feedlist-format "%4i %n %11u %t"
|
||||
articlelist-format "%4i %f %D %?T?|%-17T| ?%t"
|
||||
notify-format "%d new articles (%n unread articles, %f unread feeds)"
|
||||
|
||||
# Colors
|
||||
color background white default
|
||||
color listnormal white default
|
||||
color listfocus white black bold
|
||||
color listnormal_unread magenta default
|
||||
color listfocus_unread magenta black bold
|
||||
color info blue black bold
|
||||
color article white default
|
||||
|
||||
# Highlight
|
||||
highlight article "(^Feed:.*|^Title:.*|^Author:.*)" blue default bold
|
||||
highlight article "(^Link:.*|^Date:.*)" default default
|
||||
highlight article "https?://[^ ]+" green default
|
||||
highlight article "^(Title):.*$" blue default
|
||||
highlight article "\\[[0-9][0-9]*\\]" magenta default bold
|
||||
highlight article "\\[image\\ [0-9]+\\]" green default bold
|
||||
highlight article "\\[embedded flash: [0-9][0-9]*\\]" green default bold
|
||||
highlight article ":.*\\(link\\)$" cyan default
|
||||
highlight article ":.*\\(image\\)$" blue default
|
||||
highlight article ":.*\\(embedded flash\\)$" magenta default
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
newsboat = "${pkgs.newsboat}/bin/newsboat";
|
||||
notify = "${pkgs.libnotify}/bin/notify-send";
|
||||
signal = "${toString config.programs.waybar.settings.mainBar."custom/newsboat".signal}";
|
||||
in
|
||||
(pkgs.writeShellScriptBin "newsboat-reload" ''
|
||||
${notify} -u low 'Newsboat' 'Reloading RSS feeds...' && ${newsboat} -x reload && ${notify} -u low 'Newsboat' 'RSS feeds reloaded.' && pkill -RTMIN+${signal} waybar
|
||||
'')
|
||||
Loading…
Add table
Add a link
Reference in a new issue