Finally: Native Desktop Monitor Brightness Control

Where here "native" means "on linux" and "by building stuff with non-default build options"


I’ve been unsatisfied with the state of desktop monitor brightness control for a while1 - so much so that I’ve tried building various solutions to address the simple problem statement of: “why can’t I easily change the brightness of both of my desktop monitors in tandem without having to use the horrid OSD menu?”.

I’ve recently been using my desktop a bunch more and have been re-irritated by this, and I came to realise that Powerdevil, KDE Plasma’s power management daemon has support for talking to monitors via DDC! The one annoyance is that this is enabled by some compile-time configuration, and this isn’t enabled by default in my linux distro’s powerdevil package.

Fortunately, said distro is NixOS - so rebuilding powerdevil with this turned on is the matter of a few lines of Nix, applying an overlay to nixpkgs in my configuration:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
{ ... }: {
  # Allow users to access I2C devices for control of monitors via DDC
  hardware.i2c.enable = true;
  users.groups.i2c.members = [ "samw" ];

  # Build powerdevil with DDC support
  nixpkgs.overlays = [
    (final: prev: {
      kdePackages = prev.kdePackages.overrideScope (kFinal: kPrev: {
        powerdevil = kPrev.powerdevil.overrideAttrs {
          cmakeFlags = kPrev.powerdevil.cmakeFlags ++ [ "-DHAVE_DDCUTIL=On" ];
          buildInputs = kPrev.powerdevil.buildInputs ++ [ prev.ddcutil ];
        };
      });
    })
  ];
}

A reboot and, behold!

A screenshot of a KDE system tray showing a panel with a display brightness slider

It’s so far been very reliable for me. I’ll admit I’d be a lot less happy about having to mess around recompiling system components if it wasn’t neatly encapsulated in my overall system config, but too many posts already are just me shilling NixOS so, er. Whoops.


  1. what a statement ↩︎