wtf: a bit easier to crate new dashboards now

This commit is contained in:
Ingolf Wagner 2020-01-07 12:07:17 +13:00
parent 10919f7caa
commit 7b319051db
Signed by: palo
GPG key ID: 76BF5F1928B9618B

View file

@ -30,6 +30,84 @@ let
})|$'
'';
# default settings
wtfModule =
args@{ height ? 1, width ? 1, top, left, enabled ? true, type, ... }:
{
enabled = enabled;
focusable = false;
position.top = top;
position.left = left;
position.height = height;
position.width = width;
} // (lib.filterAttrs
(key: _: lib.all (x: x != key) [ "height" "width" "top" "left" ]) args);
modules = {
# command runner module
cmdRunner = args@{ cmd, ... }:
wtfModule ({
type = "cmdrunner";
focusable = false;
refreshInterval = 300;
} // args);
digitalclock = args@{ top, left, ... }:
wtfModule ({
type = "digitalclock";
title = "";
color = "white";
font = "bigfont";
hourFormat = 24;
refreshInterval = 1;
} // args);
clocks = args@{ top, left, ... }:
wtfModule ({
type = "clocks";
title = "";
border = false;
colors.rows = {
even = "white";
odd = "white";
};
locations = {
Berlin = "Europe/Berlin";
Wellington = "Pacific/Auckland";
};
sort = "alphabetical";
refreshInterval = 60;
} // args);
resourceusage = args@{ top, left, ... }:
wtfModule ({
type = "resourceusage";
title = "";
cpuCombined = false;
refreshInterval = 5;
} // args);
power = args@{ top, left, ... }:
wtfModule ({
type = "power";
title = "";
refreshInterval = 100;
} // args);
prettyweather = args@{ top, left, ... }:
wtfModule ({
type = "prettyweather";
title = "";
city = "Wellington";
unit = "m";
view = 0;
language = "en";
refreshInterval = 3600;
} // args);
};
qJson = {
wtf = {
@ -48,140 +126,79 @@ let
refreshInterval = 1;
mods = {
mods = with modules; {
digitalclock = {
title = "";
type = "digitalclock";
enabled = true;
color = "white";
font = "bigfont";
hourFormat = 24;
refreshInterval = 1;
position.top = 0;
position.left = 0;
position.height = 1;
position.width = 1;
};
clocks = {
title = "";
type = "clocks";
enabled = true;
border = false;
colors.rows = {
even = "white";
odd = "white";
};
locations = {
Berlin = "Europe/Berlin";
Wellington = "Pacific/Auckland";
};
sort = "alphabetical";
position.top = 1;
position.left = 0;
position.height = 1;
position.width = 1;
refreshInterval = 60;
digitalclock = digitalclock {
top = 0;
left = 0;
};
resourceusage = {
title = "";
cpuCombined = false;
enabled = true;
position.top = 0;
position.left = 1;
position.height = 1;
position.width = 1;
refreshInterval = 5;
clocks = clocks {
top = 1;
left = 0;
};
power = {
enabled = true;
position.top = 2;
position.left = 0;
position.height = 1;
position.width = 1;
refreshInterval = 100;
title = "Power";
top = resourceusage {
top = 0;
left = 1;
};
rates = {
power = power {
top = 2;
left = 0;
};
rates = wtfModule {
type = "exchangerates";
top = 3;
left = 0;
title = "rates";
enabled = true;
focusable = false;
position.top = 3;
position.left = 0;
position.height = 1;
position.width = 1;
rates.NZD = [ "EUR" ];
rates.EUR = [ "NZD" ];
};
prettyweather = {
enabled = true;
title = "";
city = "Wellington";
position.top = 0;
position.left = 2;
position.height = 1;
position.width = 1;
unit = "m";
view = 0;
language = "en";
refreshInterval = 3600;
weather = prettyweather {
top = 0;
left = 2;
};
calendar = {
type = "cmdrunner";
calendar = cmdRunner {
title = "";
focusable = false;
args = [ "-3" "--monday" "--color=never" "-w" ];
cmd = "cal";
enabled = true;
position.top = 1;
position.left = 1;
position.height = 2;
position.width = 2;
top = 1;
left = 1;
height = 2;
width = 2;
refreshInterval = 3600;
};
uptime = {
type = "cmdrunner";
uptime = cmdRunner {
title = "uptime";
focusable = false;
cmd = "uptime";
enabled = true;
position.top = 3;
position.left = 1;
position.height = 1;
position.width = 2;
refreshInterval = 300;
top = 3;
left = 1;
height = 1;
width = 2;
};
active-users = {
type = "cmdrunner";
active-users = cmdRunner {
title = "users";
focusable = false;
cmd = activeUsers;
enabled = true;
position.top = 0;
position.left = 3;
position.height = 4;
position.width = 1;
top = 0;
left = 3;
height = 4;
width = 1;
refreshInterval = 30;
};
active-tasks = {
type = "cmdrunner";
active-tasks = cmdRunner {
title = "active tasks";
focusable = false;
cmd = activeTasks;
enabled = true;
position.top = 4;
position.left = 0;
position.height = 1;
position.width = 4;
top = 4;
left = 0;
height = 1;
width = 4;
refreshInterval = 60;
};
};