modularize waybar config, TODO: styles

This commit is contained in:
Noa Aarts 2024-04-04 00:04:41 +02:00
parent 1947c56886
commit 903308080a
11 changed files with 170 additions and 75 deletions

View file

@ -0,0 +1,19 @@
{ lib, config, ... }:
let
name = "temperature";
in
{
options.modules.waybar.modules = import ./addname.nix lib name;
options.modules.waybar.${name} = {
enable = lib.mkEnableOption "enable ${name} waybar module";
};
config = lib.mkIf config.modules.waybar.${name}.enable {
programs.waybar.settings.mainbar."${name}" = {
thermal-zone = 2;
hwmon-path = "/sys/class/hwmon/hwmon3/temp1_input";
critical-threshold = 80;
format = "{temperatureC}°C {icon}";
format-icons = ["" "" ""];
};
};
}