From 64c53c243d7ca6c72341697f9f4a6594953a5fa2 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 10 Aug 2021 02:48:21 +0200 Subject: [PATCH] home: i3bar: display network throughput --- home/x/i3bar.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/home/x/i3bar.nix b/home/x/i3bar.nix index afa170e..42fc426 100644 --- a/home/x/i3bar.nix +++ b/home/x/i3bar.nix @@ -16,6 +16,12 @@ in example = ["Core 0" "Core 1" "Core 2" "Core 3"]; default = ""; }; + + networking.throughput_interfaces = mkOption { + type = types.listOf types.str; + example = [ "wlp1s0" ]; + default = [ ]; + }; }; config = lib.mkIf isEnabled { @@ -73,6 +79,18 @@ in chip = cfg.temperature.chip; inputs = cfg.temperature.inputs; } + ] ++ (lib.lists.optionals ((builtins.length cfg.networking.throughput_interfaces) != 0) + (map + (interface: + { + block = "net"; + device = interface; + interval = 1; + hide_inactive = true; + }) + + cfg.networking.throughput_interfaces) + ) ++ [ { block = "networkmanager"; primary_only = true;