package dependency: power-profiles-daemon on NixOS enable
services.power-profiles-daemon
profile-released (id: number)active-profile: string writable, e.g Balancedperformance-inhibited: stringperformance-degraded: stringprofiles: string[] list of possible active-profileactions: string[]active-profile-holds: Array<Record<string, string>>icon-name: stringconst powerProfiles = await Service.import("powerprofiles");
const label = Widget.Label({
label: powerProfiles.bind("active_profile"),
});
const button = Widget.Button({
on_clicked: () => {
switch (powerProfiles.active_profile) {
case "balanced":
powerProfiles.active_profile = "performance";
break;
default:
powerProfiles.active_profile = "balanced";
break;
}
},
});