Your external monitor’s OSD menu is buried three layers deep with awful navigation buttons. Meanwhile, you have a perfectly good keyboard. Let’s control brightness, contrast, and color the civilized way - via command line.

Install ddccontrol

1
2
3
4
5
# Ubuntu/Debian
sudo apt install ddccontrol ddccontrol-db i2c-tools

# Load i2c kernel modules
sudo modprobe i2c-dev

Detect monitors

1
2
3
4
5
# Find available monitors
ddccontrol -p

# Probe specific device
ddccontrol dev:/dev/i2c-4 -p

Example output will show your monitor model and supported controls.

Note: If you get permission errors, see the Troubleshooting section below to set up proper permissions.

Common DDC/CI register codes

RegisterControlTypical Range
0x10Brightness0-100
0x12Contrast0-100
0x16Red gain0-100
0x18Green gain0-100
0x1ABlue gain0-100
0x60Input sourceVaries by monitor
0xD6Power mode1=on, 4=standby, 5=off
0xDCDisplay ApplicationPicture modes

Read current settings

1
2
3
4
5
6
7
8
# Read brightness
ddccontrol dev:/dev/i2c-4 -r 0x10

# Read contrast
ddccontrol dev:/dev/i2c-4 -r 0x12

# Read all supported controls
ddccontrol dev:/dev/i2c-4 -r 0x10 -r 0x12 -r 0x16 -r 0x18 -r 0x1a

Write settings

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Set brightness to 80
ddccontrol dev:/dev/i2c-4 -r 0x10 -w 80

# Set contrast to 75
ddccontrol dev:/dev/i2c-4 -r 0x12 -w 75

# Adjust RGB color balance
ddccontrol dev:/dev/i2c-4 -r 0x16 -w 95  # Red
ddccontrol dev:/dev/i2c-4 -r 0x18 -w 97  # Green
ddccontrol dev:/dev/i2c-4 -r 0x1a -w 76  # Blue

My preferred monitor profile

1
2
3
4
5
6
# Custom color-calibrated settings
ddccontrol dev:/dev/i2c-4 -r 0x16 -w 95 && \
ddccontrol dev:/dev/i2c-4 -r 0x18 -w 97 && \
ddccontrol dev:/dev/i2c-4 -r 0x1a -w 76 && \
ddccontrol dev:/dev/i2c-4 -r 0x10 -w 100 && \
ddccontrol dev:/dev/i2c-4 -r 0x12 -w 80

What this does:

  • Red gain: 95
  • Green gain: 97
  • Blue gain: 76
  • Brightness: 100
  • Contrast: 80

Create preset profiles

Save as ~/.local/bin/monitor-day.sh:

1
2
3
4
5
6
7
#!/bin/bash
# Day mode - bright and cool
ddccontrol dev:/dev/i2c-4 -r 0x10 -w 100  # Brightness: 100%
ddccontrol dev:/dev/i2c-4 -r 0x12 -w 80   # Contrast: 80%
ddccontrol dev:/dev/i2c-4 -r 0x16 -w 100  # Red: 100
ddccontrol dev:/dev/i2c-4 -r 0x18 -w 100  # Green: 100
ddccontrol dev:/dev/i2c-4 -r 0x1a -w 100  # Blue: 100

Save as ~/.local/bin/monitor-night.sh:

1
2
3
4
5
6
7
#!/bin/bash
# Night mode - dim and warm
ddccontrol dev:/dev/i2c-4 -r 0x10 -w 30   # Brightness: 30%
ddccontrol dev:/dev/i2c-4 -r 0x12 -w 70   # Contrast: 70%
ddccontrol dev:/dev/i2c-4 -r 0x16 -w 100  # Red: 100
ddccontrol dev:/dev/i2c-4 -r 0x18 -w 85   # Green: 85
ddccontrol dev:/dev/i2c-4 -r 0x1a -w 60   # Blue: 60 (warmer)

Make executable:

1
chmod +x ~/.local/bin/monitor-*.sh

Usage:

1
2
monitor-day.sh
monitor-night.sh

Find your monitor’s i2c device

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# List all i2c devices
ls -l /dev/i2c-*

# Probe each one to find your monitor
for i in /dev/i2c-*; do
  echo "Probing $i"
  ddccontrol -p -d | grep -A 5 "$i"
done

# Or use ddccontrol auto-detect
ddccontrol -p

Switch input source

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Read current input
ddccontrol dev:/dev/i2c-4 -r 0x60

# Set input (values vary by monitor)
# Common values:
# 0x0F = DisplayPort 1
# 0x10 = DisplayPort 2
# 0x11 = HDMI 1
# 0x12 = HDMI 2
# 0x03 = DVI

ddccontrol dev:/dev/i2c-4 -r 0x60 -w 0x0F

Power control

1
2
3
4
5
6
7
8
# Turn monitor on
ddccontrol dev:/dev/i2c-4 -r 0xd6 -w 1

# Standby
ddccontrol dev:/dev/i2c-4 -r 0xd6 -w 4

# Power off
ddccontrol dev:/dev/i2c-4 -r 0xd6 -w 5

Troubleshooting

Permission denied

If you get permission denied errors, add your user to i2c group (recommended) or use sudo:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Add user to i2c group
sudo usermod -a -G i2c $USER

# Create udev rule for i2c devices
sudo tee /etc/udev/rules.d/99-i2c.rules <<EOF
KERNEL=="i2c-[0-9]*", GROUP="i2c", MODE="0660"
EOF

# Reload udev rules
sudo udevadm control --reload-rules
sudo udevadm trigger

# Log out and back in for group membership to take effect

Monitor not detected

1
2
3
4
5
6
7
8
# Load i2c modules
sudo modprobe i2c-dev

# Make it permanent
echo "i2c-dev" | sudo tee -a /etc/modules

# Check if module loaded
lsmod | grep i2c

Commands don’t work

Some monitors have DDC/CI disabled by default. Check your monitor’s OSD settings for an option to enable DDC/CI or external control.

Quick brightness shortcuts

Add to ~/.bashrc:

1
2
alias bright='ddccontrol dev:/dev/i2c-4 -r 0x10 -w'
alias contrast='ddccontrol dev:/dev/i2c-4 -r 0x12 -w'

Usage:

1
2
bright 80    # Set brightness to 80
contrast 75  # Set contrast to 75

GUI alternative

If you prefer GUI:

1
2
3
4
5
# Install gddccontrol (GUI frontend)
sudo apt install gddccontrol

# Run it
gddccontrol

Pro tip: Find your perfect color settings once using the monitor’s OSD, then run ddccontrol dev:/dev/i2c-4 -r 0x10 -r 0x12 -r 0x16 -r 0x18 -r 0x1a to read all the values. Save them in a script so you can restore your preferred settings instantly after firmware updates or power loss resets the monitor.