diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 03cd1bb..0b945f5 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -8,7 +8,7 @@ boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ]; boot.kernelPackages = pkgs.linuxPackages_latest; - boot.kernelModules = [ "kvm-intel" ]; + boot.kernelModules = [ "kvm-intel" "coretemp" ]; boot.extraModulePackages = [ ]; hardware.enableAllFirmware = true; diff --git a/polybar/default.nix b/polybar/default.nix index 993c8e1..67dceee 100644 --- a/polybar/default.nix +++ b/polybar/default.nix @@ -13,6 +13,7 @@ in home.packages = with pkgs; [ (pkgs.callPackage ./aozora.nix { }) (pkgs.callPackage ./polybar-now-playing.nix { }) + lm_sensors ]; services.polybar = { enable = true; @@ -50,6 +51,7 @@ in "pulseaudio" "memory" "cpu" + "cputemp" "battery" "date" ]; @@ -123,6 +125,13 @@ in format-prefix = "CPU "; format-prefix-foreground = "${primary}"; }; + "module/cputemp" = { + type = "custom/script"; + + interval = 2; + + exec = "/etc/profiles/per-user/elnu/bin/sensors | /run/current-system/sw/bin/grep \"Package id 0:\" | /run/current-system/sw/bin/tr -d '+' | /run/current-system/sw/bin/awk '{print $4}'"; + }; # TODO: Only build battery module on ThinkPad host "module/battery" = { type = "internal/battery"; @@ -132,7 +141,8 @@ in format-low = " "; label-charging = "%{F${primary}}AC%{F-} %percentage%%"; - label-discharging = "%{F${primary}}BAT%{F-} %percentage%%"; label-full = "%{F${primary}}AC%{F-}"; + label-discharging = "%{F${primary}}BAT%{F-} %percentage%%"; + label-full = "%{F${primary}}AC%{F-}"; animation-low-0 = "%{F${primary}}BAT%{F-}"; animation-low-1 = "%{F${alert}}LOW%{F-}";