3

Every time I boot my laptop I go blind. I can use xrandr to set the brightness but it becomes a rather impractical. I also use LUKS so when I boot the computer I am always greeted with (from what I think) cryptsetup.

Is there a way to run my desired xrandr command when I am asked for the encryption password? Otherwise, when is the earliest (from turning on the laptop) that I can do this and where/how should I configure this?

Amongst other stuff I have tried rc.local, /etc/gdm3/Init/Display, /etc/X11/xinit/xinitrc but nothing seems to work. I am running Ubuntu 16.10 with Gnome and the command I try to run is xrandr --output eDP-1 --brightness 0.3.

Some updates:

Some more info on my hardware and what I have tried.

  • I have the XPS 15 9550 which comes with Intel Skylake and a dedicated Nvidia graphics card. I have disabled the Nvidia card from the Nvidia X Server Settings GUI tool.
  • I have only intel_backlight in /sys/class/backlight by default. I can edit the brightness from there between 0 and 12 but the brightness at 1 is still too bright.
  • I have tried altering the /etc/default/grub to include acpi_backlight=vendor. That creates the entry /sys/class/backlight/dell_backlight. This gives some more control but it's very unstable (brightness jumping here and there and freezes).
  • I have tried altering the /etc/default/grub to include acpi_backlight=video. That creates the entry /sys/class/backlight/acpi_video0 which permits more granularity (0-66). However the monitor still uses the intel_backlight. I tried to solve this by explicitly configuring the xorg.conf to use the ACPI backlight but to no vail.
  • 1
    /etc/gdm3/Init/Display Xorg must be running for use xrandr. – Ipor Sircer Dec 21 '16 at 15:13
  • 1
    There is probably a non-X11 way to set the brightness. If you're running systemd, there is systemd-backlight. There should also be a file in /sys you can just use echo on. – derobert Dec 21 '16 at 16:03
  • If ACPI interface is available you can create a udev-rule. /etc/udev/rules.d/99-backlight.rules # Set backlight level to 9 SUBSYSTEM=="backlight", ACTION=="add", KERNEL=="acpi_video0", ATTR{brightness}="9" – user192526 Dec 21 '16 at 18:16
  • Thanks guys, the problem is that without xrandr I can only set the value between 1 and 12, where all values are extremely bright. Only solution I have found until now to set the brightness below tha is to use xrandr. – Pithikos Dec 22 '16 at 10:00
  • What exact model of graphics card do you have? If you have two, which one does X use? – Gilles Dec 22 '16 at 23:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.