Only display battery and CPU temp modules on ThinkPad
This commit is contained in:
parent
8f0f5b9bbf
commit
05a5d8f865
3 changed files with 34 additions and 26 deletions
|
@ -1,3 +1,5 @@
|
||||||
{ pkgs, ... }: {
|
{ pkgs, ... }: {
|
||||||
|
imports = [
|
||||||
|
./polybar.nix
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
31
hosts/elnupad/polybar.nix
Normal file
31
hosts/elnupad/polybar.nix
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{ pkgs, lib, ... }
|
||||||
|
|
||||||
|
{
|
||||||
|
home.packages = with pkgs; [ lm_sensors ];
|
||||||
|
services.polybar.config = {
|
||||||
|
"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}'";
|
||||||
|
};
|
||||||
|
"module/battery" = {
|
||||||
|
type = "internal/battery";
|
||||||
|
battery = "BAT0";
|
||||||
|
adapter = "AC";
|
||||||
|
|
||||||
|
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-}";
|
||||||
|
|
||||||
|
animation-low-0 = "%{F${primary}}BAT%{F-}";
|
||||||
|
animation-low-1 = "%{F${alert}}LOW%{F-}";
|
||||||
|
|
||||||
|
full-at = 96;
|
||||||
|
low-at = 10; # default
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -125,31 +125,6 @@ in
|
||||||
format-prefix = "CPU ";
|
format-prefix = "CPU ";
|
||||||
format-prefix-foreground = "${primary}";
|
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";
|
|
||||||
battery = "BAT0";
|
|
||||||
adapter = "AC";
|
|
||||||
|
|
||||||
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-}";
|
|
||||||
|
|
||||||
animation-low-0 = "%{F${primary}}BAT%{F-}";
|
|
||||||
animation-low-1 = "%{F${alert}}LOW%{F-}";
|
|
||||||
|
|
||||||
full-at = 96;
|
|
||||||
low-at = 10; # default
|
|
||||||
};
|
|
||||||
"module/date" = {
|
"module/date" = {
|
||||||
type = "internal/date";
|
type = "internal/date";
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue