1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat: configure himalaya email (and add to dashboard)

This commit is contained in:
2024-03-14 22:31:55 +01:00
parent 6a15af9f0b
commit 484c445a24
4 changed files with 53 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
writers,
formats,
wtf,
himalaya,
lib,
jq,
gh,
@@ -31,7 +32,7 @@
mods.vdir_khal = command {
title = "Calendar";
cmd = "${khal}/bin/khal";
args = ["--color" "list"];
args = ["--color" "list" "--exclude-calendar" "calendarium-tridentinum"];
refreshInterval = "1m";
position = rec {
top = 0;
@@ -136,6 +137,28 @@
width = 2;
};
};
mods.email = command {
title = "Email";
cmd = writers.writeDash "email" ''
${himalaya}/bin/himalaya accounts --output json \
| ${jq}/bin/jq -r 'map(.name) | join("\n")' \
| while read -r account
do
${himalaya}/bin/himalaya list --account "$account" -o json \
| ${jq}/bin/jq -r '
map(select(.flags == [])
| "\u001b[33m\(.from.addr)\u001b[0m \(.subject)") | join("\n")
'
done
'';
refreshInterval = "5m";
position = {
top = 2;
left = 0;
height = 4;
width = 3;
};
};
mods.gh-status = command {
enabled = true;
title = "GitHub";