Backlight: Difference between revisions

imported>Con-f-use
sys/class brightness
imported>Con-f-use
example udev rule for /sys/class method
Line 50: Line 50:
</syntaxhighlight>
</syntaxhighlight>


to set the brightness to <code>300</code>, where the maximum is stored in <code>brightness_max</code>. You can set file permissions e.g. with a udev rule, if you don't want to use sudo.
to set the brightness to <code>300</code>, where the maximum is stored in <code>brightness_max</code>. You can set file permissions e.g. with a udev rule, if you don't want to use sudo. Here is an example udev rule, where you will likely have to replace intel_backlight, with the name in your /sys/class/backlight/:
 
<syntaxhighlight lang=udev>
  services.udev.extraRules = ''
    ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="intel_backlight", MODE="0666", RUN+="${pkgs.coreutils}/bin/chmod a+w /sys/class/backlight/%k/brightness"
  '';
</syntaxhighlight>


== Tips ==
== Tips ==