home: i3bar: make temp display configurable

This commit is contained in:
Antoine Martin 2021-07-23 19:18:07 +02:00
parent cbd98189e2
commit be1e31bb78
3 changed files with 19 additions and 4 deletions

View file

@ -2,8 +2,21 @@
let
isEnabled = config.my.home.x.enable;
i3BarTheme = config.my.theme.i3BarTheme;
cfg = config.my.home.x.i3bar;
in
{
options.my.home.x.i3bar = with lib; {
temperature.chip = mkOption {
type = types.str;
example = "coretemp-isa-*";
default = "";
};
temperature.inputs = mkOption {
type = types.listOf types.str;
example = ["Core 0" "Core 1" "Core 2" "Core 3"];
default = "";
};
};
config = lib.mkIf isEnabled {
home.packages = with pkgs; [
@ -57,10 +70,8 @@ in
collapsed = false;
interval = 10;
format = "{max}";
# FIXME: specific to my AMD Ryzen CPU. Make this depend on
# hostname or something else
chip = "k10temp-pci-*";
inputs = [ "Tccd1" ];
chip = cfg.temperature.chip;
inputs = cfg.temperature.inputs;
}
{
block = "networkmanager";

View file

@ -3,6 +3,8 @@
home-manager.users.alarsyo = {
# Keyboard settings & i3 settings
my.home.x.enable = true;
my.home.x.i3bar.temperature.chip = "k10temp-pci-*";
my.home.x.i3bar.temperature.inputs = [ "Tccd1" ];
my.home.x.cursor.enable = true;
my.home.alacritty.enable = true;
my.home.emacs.enable = true;

View file

@ -3,6 +3,8 @@
home-manager.users.alarsyo = {
# Keyboard settings & i3 settings
my.home.x.enable = true;
my.home.x.i3bar.temperature.chip = "coretemp-isa-*";
my.home.x.i3bar.temperature.inputs = ["Core 0" "Core 1" "Core 2" "Core 3"];
my.home.x.cursor.enable = true;
my.home.alacritty.enable = true;
my.home.emacs.enable = true;