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

@ -1,146 +1,6 @@
* {
/* all: unset;*/
border: none;
border-radius: 0;
/* `otf-font-awesome` is required to be installed for icons */
/* font matches sway-config.nix */
font-family: "Iosevka Comfy Fixed"; /* TODO: parameterize this? */
font-weight: bold;
font-size: 12px;
min-height: 0;
padding: 0px;
}
window#waybar {
background-color: #111111;
color: #666666;
border-bottom: 2px double #fff;
border-bottom: 2px double #33ccff;
}
/*
window#waybar.termite {
background-color: #3F3F3F;
}
window#waybar.chromium {
background-color: #000000;
border: none;
}
*/
#workspaces button {
padding: 0px;
margin: 4px;
margin-left: 2px;
margin-right: 2px;
color: #cccccc;
min-width: 25px;
border: 1px solid transparent;
}
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
/*
#workspaces button:hover {
background: rgba(0, 0, 0, 0.2);
box-shadow: inherit;
border-bottom: 3px solid #ffffff;
}
*/
#workspaces button.current_output {
border-color: #aaa;
border-style: dotted;
#custom-cputemp {
padding: 0 10px;
background-color: #f0932b;
color: #ffffff;
}
#workspaces button.focused {
background-color: #aaa;
color: #000000;
border-color: #aaa;
border-style: solid;
}
#workspaces button.focused.current_output {
border-color: #ee00ff;
border-style: solid;
}
#workspaces button.urgent {
background-color: #eb4d4b;
}
#mode {
background-color: #64727D;
border-bottom: 1px solid #ffffff;
}
#tray {
background-color: #111111;
}
#clock,
#clock-time,
#battery,
#cpu,
#memory,
#temperature,
#network,
#custom-ppp,
#custom-rog,
#tray,
#mode,
#backlight,
#pulseaudio,
#idle_inhibitor,
#mpd {
/*padding: 2px;*/
padding: 0px;
padding-left: 4px;
padding-right: 4px;
margin: 4px;
margin-right: 6px;
color: #fff;
background-color: #333;
}
#battery {
}
#battery.charging {
color: #26A65B;
}
@keyframes blink {
to {
background-color: #f53c3c;
color: #ffffff;
}
}
#battery.Charging {
color: green;
}
#battery.Discharging {
color: blue;
}
#battery.Discharging.warning {
color: orange;
}
#battery.Discharging.critical {
background-color: #f53c3c;
color: #ffffff;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
/*
label:focus {
background-color: #000000;
}
*/

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}";
};
};
};