From 4b5f5442f7a7a603a50901b60a1fe57902a2e6ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Wed, 15 Apr 2020 00:08:44 +0200 Subject: [PATCH] feat(i3status-rust): corona block --- configs/i3.nix | 1 + dot/i3status-rust.nix | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/configs/i3.nix b/configs/i3.nix index 92358fc..3cc1606 100644 --- a/configs/i3.nix +++ b/configs/i3.nix @@ -90,6 +90,7 @@ in with config.niveum; { wifi-interface = networkInterfaces.wireless; batteryBlock = batteryBlocks.default; inherit (config.niveum) colours; + inherit pkgs; }) }"; }]; diff --git a/dot/i3status-rust.nix b/dot/i3status-rust.nix index 87eddc3..85faffa 100644 --- a/dot/i3status-rust.nix +++ b/dot/i3status-rust.nix @@ -1,4 +1,4 @@ -{ wifi-interface, colours, batteryBlock }: +{ pkgs, wifi-interface, colours, batteryBlock }: { theme = { name = "plain"; @@ -47,6 +47,17 @@ max_width = 35; on_collapsed_click = "spotify"; } + { + block = "custom"; + interval = 60 * 60 * 60; # hourly + command = pkgs.writers.writeDash "corona" '' + ${pkgs.curl}/bin/curl https://corona-stats.online/germany \ + | ${pkgs.gnugrep}/bin/grep Germany \ + | ${pkgs.gnused}/bin/sed 's/\s*//g' \ + | ${pkgs.ansifilter}/bin/ansifilter \ + | ${pkgs.gawk}/bin/awk -F'│' '{print "CORONA " $3 " (" $4 ") †" $5 " (" $6 ")"}' + ''; + } { block = "net"; device = wifi-interface;