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 let
isEnabled = config.my.home.x.enable; isEnabled = config.my.home.x.enable;
i3BarTheme = config.my.theme.i3BarTheme; i3BarTheme = config.my.theme.i3BarTheme;
cfg = config.my.home.x.i3bar;
in 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 { config = lib.mkIf isEnabled {
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -57,10 +70,8 @@ in
collapsed = false; collapsed = false;
interval = 10; interval = 10;
format = "{max}"; format = "{max}";
# FIXME: specific to my AMD Ryzen CPU. Make this depend on chip = cfg.temperature.chip;
# hostname or something else inputs = cfg.temperature.inputs;
chip = "k10temp-pci-*";
inputs = [ "Tccd1" ];
} }
{ {
block = "networkmanager"; block = "networkmanager";

View file

@ -3,6 +3,8 @@
home-manager.users.alarsyo = { home-manager.users.alarsyo = {
# Keyboard settings & i3 settings # Keyboard settings & i3 settings
my.home.x.enable = true; 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.x.cursor.enable = true;
my.home.alacritty.enable = true; my.home.alacritty.enable = true;
my.home.emacs.enable = true; my.home.emacs.enable = true;

View file

@ -3,6 +3,8 @@
home-manager.users.alarsyo = { home-manager.users.alarsyo = {
# Keyboard settings & i3 settings # Keyboard settings & i3 settings
my.home.x.enable = true; 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.x.cursor.enable = true;
my.home.alacritty.enable = true; my.home.alacritty.enable = true;
my.home.emacs.enable = true; my.home.emacs.enable = true;