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,18 +215,8 @@ in {
output_format = "i3bar";
};
modules = mergeAttrs {
# todo MPD module (using read_file most likely, or switch to i3blocks)
"read_file mpd" = {
position = -1;
settings = {
format = "%content";
path = "/tmp/i3-mpd-status-stuff";
color_good = "#ffffff";
};
};
modules = mergeAttrsList [
{
"cpu_usage" = {
position = 0;
settings = {
@ -258,7 +248,8 @@ in {
format = "%Y-%m-%d %H:%M:%S (%A)";
};
};
} (optionalAttrs cfg.battery {
}
(optionalAttrs cfg.battery {
"battery 0" = {
position = 3;
settings = {
@ -270,7 +261,19 @@ in {
low_threshold = 30;
};
};
});
})
(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";
};
};
})
];
};
home.packages = with pkgs; [