forgot about da battery :-P

This commit is contained in:
krizej 2024-08-04 00:38:28 +02:00
parent c890911af4
commit 18c8f8769e
2 changed files with 22 additions and 5 deletions

View file

@ -51,13 +51,17 @@
documentation.enable = true; documentation.enable = true;
theme.enable = true; theme.enable = true;
printing.enable = true; printing.enable = true;
i3.enable = true;
xserver = { xserver = {
enable = true; enable = true;
libinput = true; libinput = true;
}; };
i3 = {
enable = true;
battery = true;
};
gaming = { gaming = {
enable = true; enable = true;
homm3 = true; homm3 = true;

View file

@ -1,5 +1,5 @@
{ lib, pkgs, config, ...}: let { lib, pkgs, config, ...}: let
inherit (lib) mkIf mkEnableOption mkOption types optionals; inherit (lib) mkIf mkEnableOption mkOption types optionals mergeAttrs optionalAttrs;
cfg = config.chuj.stuff.i3; cfg = config.chuj.stuff.i3;
user = config.chuj.system.user; user = config.chuj.system.user;
in { in {
@ -24,6 +24,7 @@ in {
}; };
default = {}; default = {};
}; };
battery = mkEnableOption "battery";
}; };
config = let config = let
@ -205,7 +206,7 @@ in {
output_format = "i3bar"; output_format = "i3bar";
}; };
modules = { modules = mergeAttrs {
# todo MPD module (using read_file most likely, or switch to i3blocks) # todo MPD module (using read_file most likely, or switch to i3blocks)
"cpu_usage" = { "cpu_usage" = {
@ -234,12 +235,24 @@ in {
}; };
"tztime local" = { "tztime local" = {
position = 3; position = 4;
settings = { settings = {
format = "%Y-%m-%d %H:%M:%S (%A)"; format = "%Y-%m-%d %H:%M:%S (%A)";
}; };
}; };
}; } (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; [