fix some stuffs and improve some stuffs

This commit is contained in:
krizej 2024-08-08 00:34:02 +02:00
parent 2def094022
commit f070dded55
2 changed files with 54 additions and 50 deletions

View file

@ -37,6 +37,7 @@
};
home-manager.enable = true;
xdg.enable = true;
stuff = {
sddm.enable = true;
@ -51,7 +52,7 @@
documentation.enable = true;
theme.enable = true;
printing.enable = true;
xdg.enable = true;
mpd.enable = true;
xserver = {
enable = true;

View file

@ -1,5 +1,5 @@
{ lib, pkgs, config, ...}: let
inherit (lib) mkIf mkEnableOption mkOption types optionals mergeAttrs optionalAttrs;
inherit (lib) mkIf mkEnableOption mkOption types optionals mergeAttrs mergeAttrsList optionalAttrs;
cfg = config.chuj.stuff.i3;
user = config.chuj.system.user;
in {
@ -215,62 +215,65 @@ in {
output_format = "i3bar";
};
modules = mergeAttrs {
# todo MPD module (using read_file most likely, or switch to i3blocks)
modules = mergeAttrsList [
{
"cpu_usage" = {
position = 0;
settings = {
format = "cpu: %usage";
};
};
"read_file mpd" = {
position = -1;
settings = {
format = "%content";
path = "/tmp/i3-mpd-status-stuff";
color_good = "#ffffff";
"memory" = {
position = 1;
settings = {
format = "mem: %used";
threshold_degraded = "1G";
format_degraded = "MEMORY < %available";
};
};
};
"cpu_usage" = {
position = 0;
settings = {
format = "cpu: %usage";
"volume master" = {
position = 2;
settings = {
color_degraded = "#333333";
format = "vol: %volume";
format_muted = "vol: ---";
};
};
};
"memory" = {
position = 1;
settings = {
format = "mem: %used";
threshold_degraded = "1G";
format_degraded = "MEMORY < %available";
"tztime local" = {
position = 4;
settings = {
format = "%Y-%m-%d %H:%M:%S (%A)";
};
};
};
"volume master" = {
position = 2;
settings = {
color_degraded = "#333333";
format = "vol: %volume";
format_muted = "vol: ---";
}
(optionalAttrs cfg.battery {
"battery 0" = {
position = 3;
settings = {
format = "bat%status: %percentage";
status_chr = "(+)";
status_bat = "";
status_unk = "(?)";
status_full = "(+)";
low_threshold = 30;
};
};
};
"tztime local" = {
position = 4;
settings = {
format = "%Y-%m-%d %H:%M:%S (%A)";
})
(optionalAttrs config.chuj.stuff.mpd.enable {
"read_file mpd" = {
position = -1;
settings = {
format = "%content";
format_bad = "mpdstatus file not found, restart i3";
path = "/tmp/i3-mpd-status-stuff";
color_good = "#ffffff";
};
};
};
} (optionalAttrs cfg.battery {
"battery 0" = {
position = 3;
settings = {
format = "bat%status: %percentage";
status_chr = "(+)";
status_bat = "";
status_unk = "(?)";
status_full = "(+)";
low_threshold = 30;
};
};
});
})
];
};
home.packages = with pkgs; [