Some scripts for basic monitor control over DDC
-
dim.sh
– set brightness of all displays at once -
swim.sh
– switch monitor input sourceNote: there can be some flickering just after switching (intensity varies, sometimes it’s pretty bad) but this seems to go away pretty quickly. Jury is still out on whether this is bad for the monitor(s), so use at your own risk.
-
Install ddcutil, i2c-tools, jq On Manjaro/Arch, all of these are available via
pacman
or the AUR -
Double check which VCP codes your monitor(s) actually support with
ddcutil capabilities
. The following codes are required (along with their default values as set incommon.sh
)-
Brightness 🡒 VCP 10
-
Input source 🡒 VCP 60
-
-
Run any of the scripts listed above. A configuration file will be generated at
~/.config/ddc-scripts
.{ "about": "configuration file for https:/github.com/ybnd/ddc-scripts", "vcp": { "brightness": 10, // you can adjust these if necessary "input_source": 60 }, "aliases": { // you can define value aliases here }, "displays": { // auto-detected connected displays "6": { // numbers correspond to i2c buses, i.e. /dev/i2c-6 "name": "Display 6", }, "9": { "name": "Display 9", } } }
Add aliases to make specific values easier to remember. For instance, you can assign easy-to-remember names for input sources based on what you connect to them:
$ ddcutil capabilities
Model: ...
MCCS version: ...
Commands:
...
VCP Features:
...
Feature: 60 (Input Source)
Values:
0f: DisplayPort-1 # Let's say this is a computer
10: DisplayPort-2
11: HDMI-1 # ...and this is a TV
12: HDMI-2
...
In ~/.config/ddc-scripts
, configure the following aliases
"aliases": {
"computer": "0f",
"tv": "11"
},
Now you can use these with swim.sh
$ swim tv
Display 1: 0f 🡒 11
$ swim computer
Display 1: 11 🡒 0f