This commit is contained in:
2026-03-13 10:24:07 +00:00
parent 6c33f7f53e
commit 8229f20975
3 changed files with 71 additions and 6 deletions

View File

@@ -0,0 +1,51 @@
{ modules, den, ... }:
{
modules.tdp = settings: {
nixos =
{ pkgs, ... }:
let
batt-tdp = pkgs.writeShellScript "batt-cpu-tdp" ''
${pkgs.powercap}/bin/powercap-set intel-rapl -z 0 -c 0 -l ${
toString (settings.batt.cpu.long-term * 1000000)
}
${pkgs.powercap}/bin/powercap-set intel-rapl -z 0 -c 0 -l ${
toString (settings.batt.cpu.short-term * 1000000)
}
'';
ac-tdp = pkgs.writeShellScript "ac-cpu-tdp" ''
${pkgs.powercap}/bin/powercap-set intel-rapl -z 0 -c 0 -l ${
toString (settings.ac.cpu.long-term * 1000000)
}
${pkgs.powercap}/bin/powercap-set intel-rapl -z 0 -c 0 -l ${
toString (settings.ac.cpu.short-term * 1000000)
}
'';
in
{
systemd.services.tdp-on-batt = {
enable = true;
before = [ "battery.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${batt-tdp}";
RemainAfterExit = true;
};
wantedBy = [ "battery.target" ];
partOf = [ "battery.target" ];
};
systemd.services.tdp-on-ac = {
enable = true;
before = [ "ac.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${ac-tdp}";
RemainAfterExit = true;
};
wantedBy = [ "ac.target" ];
partOf = [ "ac.target" ];
};
};
};
}

View File

@@ -26,7 +26,7 @@ Item {
name: "FOCUSED"
PropertyChanges {
target: content
width: 10
implicitWidth: 10
scale: 1
}
},
@@ -34,7 +34,7 @@ Item {
name: "EXISTS"
PropertyChanges {
target: content
width: 10
implicitWidth: 10
scale: 0.85
}
},
@@ -42,15 +42,15 @@ Item {
name: "NOT"
PropertyChanges {
target: content
width: 10
implicitWidth: 10
scale: 0.75
}
}
]
height: 15
Rectangle {
width: parent.width
height: parent.height
implicitWidth: parent.width
implicitHeight: parent.height
radius: 2.5
color: {
if (HyprlandHelpers.getHyprlandWorkspaceById(index + 1) != null) {