Skip to content

Commit 27dfa61

Browse files
authored
feat(powerdevil): support declaring keyboard backlight brightness (#537)
1 parent 205dcfd commit 27dfa61

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

modules/powerdevil.nix

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,22 @@ let
172172
The brightness to set the display to in this mode.
173173
'';
174174
};
175+
dimKeyboard = {
176+
enable = lib.mkOption {
177+
type = with lib.types; nullOr bool;
178+
default = null;
179+
example = false;
180+
description = "Whether to enable keyboard backlight dimming.";
181+
};
182+
};
183+
keyboardBrightness = lib.mkOption {
184+
type = with lib.types; nullOr (ints.between 0 100);
185+
default = null;
186+
example = 10;
187+
description = ''
188+
The brightness to set the keyboard backlight to in this mode.
189+
'';
190+
};
175191
powerProfile = lib.mkOption {
176192
type =
177193
with lib.types;
@@ -226,6 +242,12 @@ let
226242
if (cfg.powerdevil.${optionsName}.displayBrightness == null) then null else true
227243
);
228244
};
245+
"${cfgSectName}/Keyboard" = {
246+
KeyboardBrightness = cfg.powerdevil.${optionsName}.keyboardBrightness;
247+
UseProfileSpecificKeyboardBrightness = (
248+
if (cfg.powerdevil.${optionsName}.keyboardBrightness == null) then null else true
249+
);
250+
};
229251
"${cfgSectName}/Performance" = {
230252
PowerProfile = cfg.powerdevil.${optionsName}.powerProfile;
231253
};

0 commit comments

Comments
 (0)