{ config, lib, pkgs, ... }: let # Grab settings from the submodule cfg = config.libkookie.ui.i3.i3Status; colors = if cfg.colors then "true" else "false"; interval = (builtins.toString cfg.interval); # Utility functions to build the config append = (seg: "order += \"${seg}\""); in with lib.mkIf; { text = '' general { colors = ${colors} interval = ${interval} } ${lib.concatMapStringsSep "\n" (l: append l) cfg.segments} wireless _first_ { format_up = "W: (%quality at %essid, %bitrate) %ip" format_down = "W: down" } ethernet _first_ { format_up = "E: %ip (%speed)" format_down = "E: " } tztime local { format = "%Y-%m-%d %H:%M:%S" } load { format = "%1min" } disk "/" { format = "%avail" } battery 0 { format = "%status %percentage %remaining %emptytime" format_down = "NO BAT" low_threshold = 10 } ''; }