This page is part of my digital garden.

This page might be unfinished or have typos. These pages are meant as part of a public living notebook to be edited over time. For more, visit the page explaining the concept of a digitial garden.

DDC/CI Monitor Control

DDC/CI is an [i2c]1 protocol for controlling your monitors' brightness, contrast, color, and input selection.

It’s extremely useful to understand it for things like Desktops because often Windows/MacOS and etc will not setup brightness/etc support for your monitor by default which can make it really annoying working in a dark/bright room and a montior which isn’t configured correctly.

It’s also very useful for dual computer setups because it can tell the monitor to switch inputs without requiring touching the monitor. Some have created custom tools which monitor the USB devices connected and when swapping keyboard/mouse devices via a USB switch telling DDC to switch to the correct input.

@haimgel on github describes how he wrote two programs, one for mac and one for windows, which watches for his USB Switch and uses DDC/CI to switch the inputs as needed: https://haim.dev/posts/2020-07-28-dual-monitor-kvm/ [github]

Windows

To control your monitor install Monitorian in the Windows Store. Also checkout the github repo: github.com/emoacht/Monitorian.

MacOS

To control your monitor install Monitor Control via brew: brew install --cask monitorcontrol or checkout the github repo: github.com/MonitorControl/MonitorControl

Linux

You have several options in Linux and they all start with making sure the i2c-dev kernel module is enabled so apps can talk to your monitor. You may also want to update udev rules to allow users of a certain group to access specific i2c devices without sudo.

There is ddccontrol but it appears unmaintained and the supposedly correct tool to use is ddcutil. There are extensions for Gnome 3 to control ddcutil from the system tray, but you could also just create some bash scripts/functions as well to set things via the terminal.

NixOS

To install in NixOS add ddcutil, ddcui, and gnomeExtensions.brightness-control-using-ddcutil to your system packages.

Then also configure udev rules for the ddc group to use it without sudo

services.udev.extraRules = ''KERNEL=="i2c-[0-9]*", GROUP="ddc", MODE="0660", PROGRAM="${pkgs.ddcutil}/bin/ddcutil --bus=%n getvcp 0x10"'';

Make sure to create a ddc group and add it to the users you want to control the monitor brightness. For example:

  users.groups.ddc = { };
  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users.cmp = {
    isNormalUser = true;
    extraGroups = [ "wheel" "networkmanager" "ddc" ];
  };

  1. https://en.wikipedia.org/wiki/I%C2%B2C ↩︎

Last updated on