wtf: add news dashboard

This commit is contained in:
Ingolf Wagner 2020-01-10 23:54:09 +13:00
parent a69e393644
commit 4efc31f5f7
Signed by: palo
GPG key ID: 76BF5F1928B9618B

View file

@ -146,26 +146,115 @@ let
refreshInterval = 3600;
} // args);
feedreader = args@{ top, left, feeds, ... }:
wtfModule ({
type = "feedreader";
title = "";
#refreshInterval = 3600;
focusable = true;
#feedLimit = 10;
colors.rows = {
even = "white";
odd = "white";
};
} // args);
github = args@{ top, left, username, apiKey, ... }:
wtfModule ({
type = "github";
title = "";
refreshInterval = 3600;
feedlimit = 10;
enableStatus = true;
# customQueries:
# othersPRs:
# title: "Others Pull Requests"
# filter: "is:open is:pr -author:wtfutil"
# repositories:
# - "wtfutil/wtf"
# - "wtfutil/docs"
# - "umbrella-corp/wesker-api"
} // args);
};
qJson = {
newsJson = {
wtf = {
term = "rxvt-unicode-256color";
colors.border = {
focusable = "darkslateblue";
focused = "orange";
normal = "green";
};
grid = {
columns = [ 28 0 ];
rows = [ 9 9 9 9 9 9 0 ];
};
refreshInterval = 1;
mods = with modules; {
clock = cmdRunner {
cmd = pkgs.writers.writeDash "clock" ''
${pkgs.figlet}/bin/figlet -f smslant `date +%H:%M`
'';
title = "clock";
top = 0;
left = 0;
refreshInterval = 30;
};
weather = prettyweather {
top = 1;
left = 0;
};
# feeds
hackernews = feedreader {
title = "Hacker News";
top = 0;
left = 1;
height = 2;
feeds = [ "https://news.ycombinator.com/rss" ];
};
nixos = feedreader {
title = "NixOS Weekly";
top = 2;
left = 1;
height = 1;
feeds = [ "https://weekly.nixos.org/feeds/all.rss.xml" ];
};
taskwarrior = feedreader {
title = "Taskwarrior";
top = 3;
left = 1;
height = 1;
feeds = [ "https://taskwarrior.org/feed.rss" ];
};
#github = github {
# username = "mrVanDalo";
# apiKey = "";
# repositories = [
# "nixos/nixpkgs"
# ];
#};
};
};
};
qJson = {
wtf = {
term = "rxvt-unicode-256color";
colors.border = {
focusable = "darkslateblue";
focused = "orange";
normal = "green";
};
grid = {
columns = [ 33 12 28 36 0 ];
rows = [ 9 3 7 6 0 ];
};
refreshInterval = 1;
mods = with modules; {
digitalclock = digitalclock {
@ -268,18 +357,26 @@ let
};
};
qConfig = pkgs.writeText "config.yml" (builtins.toJSON qJson);
q = pkgs.writers.writeBashBin "q" ''
${unstable.wtf}/bin/wtfutil --config=${toString qConfig}
createDashboard = { json, name }:
let configuration = pkgs.writeText "config.yml" (builtins.toJSON json);
in pkgs.writers.writeBashBin name ''
${unstable.wtf}/bin/wtfutil --config=${toString configuration}
'';
in {
services.upower.enable = true;
environment.systemPackages = [
unstable.wtf
q
(createDashboard {
json = qJson;
name = "q";
})
(createDashboard {
json = newsJson;
name = "news";
})
#activeUsers
#activeTasks
pkgs.upower