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; home-manager.enable = true;
xdg.enable = true;
stuff = { stuff = {
sddm.enable = true; sddm.enable = true;
@ -51,7 +52,7 @@
documentation.enable = true; documentation.enable = true;
theme.enable = true; theme.enable = true;
printing.enable = true; printing.enable = true;
xdg.enable = true; mpd.enable = true;
xserver = { xserver = {
enable = true; enable = true;

View file

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