From 06b8c903edaed2a515e33f74d87921de3c749f7b Mon Sep 17 00:00:00 2001 From: 514fpv Date: Thu, 4 Jan 2024 11:48:09 +0800 Subject: [PATCH] home(i3status): add i3status setup --- home/i3status/home.nix | 77 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 home/i3status/home.nix diff --git a/home/i3status/home.nix b/home/i3status/home.nix new file mode 100644 index 00000000..4ef150ef --- /dev/null +++ b/home/i3status/home.nix @@ -0,0 +1,77 @@ +{ pkgs +, lib +, config +, ... }: with lib; mkIf config.passthrough.gui { + programs.i3status = { + enable = true; + enableDefault = false; + general.colors = true; + general.interval = 1; + + modules = { + "ethernet _first_" = { + position = 1; + settings = { + format_up = "%ip at %speed"; + format_down = ""; + }; + }; + + "wireless _first_" = { + position = 2; + settings = { + format_up = ''%ip at %bitrate (\"%essid\"%quality @ %frequency)''; + format_down = ""; + }; + }; + + "disk /nix/persist" = { + position = 3; + settings = { + format = "%avail (%percentage_avail)"; + threshold_type = "percentage_free"; + low_threshold = 25; + }; + }; + + memory = { + position = 4; + settings = { + format = "%used / %total"; + threshold_degraded = "10%"; + threshold_critical = "5%"; + format_degraded = ">>> %used / %total <<<"; + }; + }; + + load = { + position = 5; + settings = { + format = "%1min %5min %15min"; + max_threshold = + removeSuffix "\n" (builtins.readFile (pkgs.runCommandLocal "nproc" { } "nproc > $out")); + }; + }; + + "battery all" = { + position = 6; + settings = { + format = "%status%percentage @ %consumption ~ %remaining"; + format_down = ""; + status_chr = "^"; + status_full = ""; + status_unk = "?"; + status_bat = ""; + last_full_capacity = true; + threshold_type = "percentage"; + low_threshold = "15"; + }; + }; + + "tztime local" = { + position = 127; + settings = { format = "%Y-%m-%d %H:%M:%S"; }; + }; + }; + }; +}