File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 4949 '' ;
5050 } ;
5151
52+ minBrightness = lib . mkOption {
53+ type = lib . types . numbers . between 0 100 ;
54+ default = 0.1 ;
55+ description = ''
56+ The minimum authorized brightness value, e.g. to avoid the
57+ display going dark.
58+ '' ;
59+ } ;
60+
5261 } ;
5362
5463 } ;
6372 let
6473 light = "${ pkgs . light } /bin/light" ;
6574 step = builtins . toString cfg . brightnessKeys . step ;
75+ minBrightness = builtins . toString cfg . brightnessKeys . minBrightness ;
6676 in
6777 [
6878 {
6979 keys = [ 224 ] ;
7080 events = [ "key" ] ;
71- # Use minimum brightness 0.1 so the display won't go totally black.
72- command = "${ light } -N 0.1 && ${ light } -U ${ step } " ;
81+ # -N is used to ensure that value >= minBrightness
82+ command = "${ light } -N ${ minBrightness } && ${ light } -U ${ step } " ;
7383 }
7484 {
7585 keys = [ 225 ] ;
You can’t perform that action at this time.
0 commit comments