Skip to content

Commit

Permalink
feat(i3status-rust): show unread miniflux items
Browse files Browse the repository at this point in the history
  • Loading branch information
kmein committed Oct 10, 2023
1 parent d7c3e03 commit 04738b9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions configs/i3status-rust.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
config,
...
}: {
age.secrets = {
miniflux-api-token = {
file = ../secrets/miniflux-api-token.age;
owner = config.users.users.me.name;
group = config.users.users.me.group;
mode = "400";
};
};

home-manager.users.me = {
programs.i3status-rust = {
enable = true;
Expand Down Expand Up @@ -64,6 +73,24 @@
print("↑{} ↓{} {}{}".format(sun["sunrise"].strftime("%R"), sun["sunset"].strftime("%R"), "☽" if current_phase < 14 else "☾", round(current_phase, 1)))
'';
}
{
block = "custom";
interval = 5 * 60;
hide_when_empty = true;
json = true;
icons_overrides.update = "";
command = let
minifluxEndpoint = "https://feed.kmein.de";
in
pkgs.writers.writeDash "miniflux" ''
MINIFLUX_TOKEN=$(cat ${config.age.secrets.miniflux-api-token.path})
${pkgs.curl}/bin/curl --insecure --header "X-Auth-Token: $MINIFLUX_TOKEN" ${minifluxEndpoint}/v1/feeds/counters \
| ${pkgs.jq}/bin/jq '{
text: ((.unreads | values | add) // 0) | tostring,
icon: "update"
}'
'';
}
{
block = "github";
info = ["total"];
Expand Down
2 changes: 1 addition & 1 deletion secrets
Submodule secrets updated from e13c0c to a76ba0

0 comments on commit 04738b9

Please sign in to comment.