How to use the command ddcutil (with examples)
- Linux
- December 25, 2023
DDCUtil is a command-line tool that allows you to control the settings of connected displays via DDC/CI (Display Data Channel/Command Interface). It requires the kernel module i2c-dev
to be loaded.
Use case 1: List all compatible displays
Code:
ddcutil detect
Motivation: This use case allows you to check which displays are compatible and can be controlled using DDCUtil.
Explanation:
ddcutil
- the command to invoke the DDCUtil tooldetect
- the specific command option to list all compatible displays
Example Output:
Display 1 - DELL U2415
Display 2 - LG 27UK850
Use case 2: Change the brightness of display 1 to 50%
Code:
ddcutil --display 1 setvcp 10 50
Motivation: This use case allows you to adjust the brightness of a specific display, in this case, display 1, to your desired level.
Explanation:
--display 1
- specifies which display to target (in this case, display 1)setvcp
- the specific command option to set a VCP (Virtual Control Panel) value10
- the VCP code for brightness50
- the value to set the brightness to (in this case, 50%)
Example Output:
Setting brightness of Display 1 to 50%: Success
Use case 3: Increase the contrast of display 1 by 5%
Code:
ddcutil -d 1 setvcp 12 + 5
Motivation: This use case allows you to adjust the contrast of a specific display, in this case, display 1, by a certain percentage.
Explanation:
-d 1
- specifies which display to target (in this case, display 1)setvcp
- the specific command option to set a VCP (Virtual Control Panel) value12
- the VCP code for contrast+ 5
- the increase in contrast by 5%
Example Output:
Increasing contrast of Display 1 by 5%: Success
Use case 4: Read the settings of display 1
Code:
ddcutil -d 1 getvcp ALL
Motivation: This use case allows you to retrieve the current settings of a specific display, in this case, display 1.
Explanation:
-d 1
- specifies which display to target (in this case, display 1)getvcp
- the specific command option to get the VCP (Virtual Control Panel) valuesALL
- the option to retrieve all available VCP values
Example Output:
Display 1 - DELL U2415
-----------------------
Brightness: 50%
Contrast: 80%
Color Temperature: 6500K
Conclusion:
The ddcutil
command provides a convenient way to control the settings of connected displays via DDC/CI. It allows you to list compatible displays, adjust brightness and contrast settings, as well as retrieve the current settings of a display. With its ease of use and versatility, DDCUtil simplifies display management and customization.