current
 1{lib, ...}: {
 2  den.aspects.desktop.provides.de.provides.plasma6.includes = [
 3    # AC is compatible for all hosts
 4    {
 5      homeManager.programs.plasma.powerdevil.AC = {
 6        powerProfile = "performance";
 7        # Auto Power Save
 8        autoSuspend.action = "nothing";
 9        turnOffDisplay = {
10          idleTimeout = 14400;
11          idleTimeoutWhenLocked = 600;
12        };
13        dimDisplay.enable = false;
14        # Actions
15        whenLaptopLidClosed = "sleep";
16        whenSleepingEnter = "standby";
17        powerButtonAction = "hibernate";
18      };
19    }
20    ({host, ...}: {
21      homeManager.programs.plasma.powerdevil = {
22        AC.inhibitLidActionWhenExternalMonitorConnected = host.usage == "laptop";
23        battery = lib.mkIf (host.usage == "laptop") {
24          powerProfile = "powerSaving";
25          # Auto Power Save
26          autoSuspend = {
27            action = "sleep";
28            idleTimeout = 600;
29          };
30          turnOffDisplay = {
31            idleTimeout = 360;
32            idleTimeoutWhenLocked = 120;
33          };
34          dimDisplay = {
35            enable = true;
36            idleTimeout = 120;
37          };
38          # Actions
39          whenLaptopLidClosed = "hibernate";
40          whenSleepingEnter = "standbyThenHibernate";
41          powerButtonAction = "shutDown";
42          inhibitLidActionWhenExternalMonitorConnected = true;
43        };
44        lowBattery = lib.mkIf (host.usage == "laptop") {
45          powerProfile = "powerSaving";
46          # Auto Power Save
47          autoSuspend = {
48            action = "sleep";
49            idleTimeout = 300;
50          };
51          turnOffDisplay = {
52            idleTimeout = 180;
53            idleTimeoutWhenLocked = 60;
54          };
55          dimDisplay = {
56            enable = true;
57            idleTimeout = 60;
58          };
59          # Actions
60          whenLaptopLidClosed = "hibernate";
61          whenSleepingEnter = "standbyThenHibernate";
62          powerButtonAction = "shutDown";
63          inhibitLidActionWhenExternalMonitorConnected = true;
64        };
65      };
66    })
67  ];
68}