Add CPU temperature module to polybar
This commit is contained in:
parent
b9b2977406
commit
f554a9038b
2 changed files with 12 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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 = "<animation-low> <label-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-}";
|
||||
|
|
Loading…
Add table
Reference in a new issue