feat(t14): add power and fan control

This commit is contained in:
steveej 2023-05-25 11:29:46 +02:00
parent acaa6dc4cf
commit 7df87bf0bb
3 changed files with 79 additions and 148 deletions

View file

@ -10,7 +10,8 @@
programs.waybar = {
enable = true;
package = repoFlake.inputs.nixpkgs-wayland.outputs.packages.${pkgs.stdenv.hostPlatform.system}.waybar;
# style = pkgs.lib.readFile ./waybar.css;
style = pkgs.lib.readFile "${pkgs.waybar.src}/resources/style.css"
+ pkgs.lib.readFile ./waybar.css;
systemd.enable = true;
settings = {
mainBar = {
@ -44,7 +45,7 @@
"cpu"
"memory"
"temperature"
"custom/cputemp"
"custom/fan"
"battery"
"pulseaudio"
@ -60,19 +61,24 @@
hwmon-path = "/sys/class/hwmon/hwmon3/temp1_input";
format = " {temperatureC} °C";
};
"custom/fan" = {
"custom/cputemp" = {
format = " {}";
exec = "${pkgs.lm_sensors}/bin/sensors | ${pkgs.gawk}/bin/awk '/CPU:/ {print $2}'";
interval = 2;
};
"custom/fan" = {
format = " {} rpm ";
exec = "${pkgs.lm_sensors}/bin/sensors | ${pkgs.gawk}/bin/awk '/fan1:/ {print $2}'";
interval = 5;
interval = 2;
};
battery.format = "🔋 {}%";
pulseaudio = {
format = "🔉 {volume}%";
# on-click-middle = ''${pkgs.sway}/bin/swaymsg exec "${pkgs.pavucontrol}/bin/pavucontrol"'';
};
"clock#date".format = "{:%d %b %Y}";
clock.format = "{:%H:%M %p}";
"clock#date".format = "{:%a, %d %b '%y}";
};
};
};