cvt

displaylinux
The cvt command is one of the most frequently used commands in Linux/Unix-like operating systems. cvt The cvt command calculates VESA CVT (Coordinated Video Timing) modelines for use with X server. It generates the appropriate modeline parameters for a given resolution and refresh rate.

Quick Reference

Command Name:

cvt

Category:

display

Platform:

linux

Basic Usage:

cvt [options] [arguments]

Common Use Cases

  • 1

    Display mode generation

    Generate X11 display modes for monitors

  • 2

    Monitor configuration

    Configure monitor settings and resolutions

  • 3

    X11 setup

    Set up X11 display configurations

  • 4

    Display optimization

    Optimize display settings for different monitors

Syntax

cvt width height [refresh]

Options

Option Description
-v, --verbose Be more verbose
-r, --reduced Use reduced blanking (for LCD displays)
-h, --help Display help message

Examples

How to Use These Examples

The examples below show common ways to use the cvt command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.

Basic Examples:

Generate modeline for 1920x1080 at 60Hz (default refresh rate)
cvt 1920 1080
Generate modeline for 1366x768 at 60Hz
cvt 1366 768 60
Generate modeline for 2560x1440 at 75Hz
cvt 2560 1440 75

Advanced Examples:

Generate modeline for 1920x1080 at 60Hz with reduced blanking (for LCD)
cvt -r 1920 1080 60
Generate modeline for 3840x2160 (4K) at 30Hz
cvt 3840 2160 30
Use cvt output with xrandr to create a new mode
cvt 1920 1080 60
xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync xrandr --addmode VGA1 "1920x1080_60.00"
Generate modeline for 1440x900 at 60Hz
cvt 1440 900 60
Generate modeline for 1680x1050 at 60Hz with reduced blanking
cvt -r 1680 1050 60
Generate modeline for 1920x1200 at 60Hz
cvt 1920 1200 60

Try It Yourself

Practice makes perfect! The best way to learn is by trying these examples on your own system with real files.

Understanding Syntax

Pay attention to the syntax coloring: commands, options, and file paths are highlighted differently.

Notes

Understanding Modelines:

A modeline is a specific format of timing parameters that the X Window System uses to describe video modes. The cvt command simplifies the creation of these parameters based on the VESA Coordinated Video Timing standard.

Modeline Format:

The output of cvt is a modeline in the following format:

Modeline "name" pixel_clock hdisp hsyncstart hsyncend htotal vdisp vsyncstart vsyncend vtotal [flags]

Where:

  • name: A descriptive name for the mode, typically containing resolution and refresh rate
  • pixel_clock: The pixel clock frequency in MHz
  • hdisp, hsyncstart, hsyncend, htotal: Horizontal timing parameters
  • vdisp, vsyncstart, vsyncend, vtotal: Vertical timing parameters
  • flags: Additional flags like +hsync, -hsync, +vsync, -vsync to indicate sync polarity

Practical Usage:

The cvt command is commonly used for:

  • Setting custom resolutions that are not automatically detected
  • Adding support for new monitors or unusual display modes
  • Creating resolutions optimized for specific displays
  • Troubleshooting display issues where standard modes don't work correctly

Using with xrandr:

The typical workflow is:

  1. Generate the modeline with cvt
  2. Use xrandr --newmode to create the mode
  3. Use xrandr --addmode to associate the mode with a specific output
  4. Use xrandr --output to activate the mode

The -r (Reduced Blanking) Option:

Reduced blanking is a technique that reduces the time spent in the blanking interval between frames, which is particularly useful for:

  • LCD displays that don't require as much blanking time as CRTs
  • Achieving higher refresh rates
  • Reducing bandwidth requirements
  • Power saving on some displays

Limitations:

  • The cvt command only generates standard VESA CVT modelines
  • Some displays may not support all modelines even if they claim to support the resolution
  • For older CRT monitors or very specific timing requirements, the gtf command may be more appropriate
  • Some hardware may have limitations on pixel clocks or total resolution

Common Use Cases

Display mode generation

Generate X11 display modes for monitors

Monitor configuration

Configure monitor settings and resolutions

X11 setup

Set up X11 display configurations

Display optimization

Optimize display settings for different monitors

System administration

Configure display settings for multi-monitor setups

Related Commands

These commands are frequently used alongside cvt or serve similar purposes:

Use Cases

1

Display mode generation

Generate X11 display modes for monitors

2

Monitor configuration

Configure monitor settings and resolutions

3

X11 setup

Set up X11 display configurations

4

Display optimization

Optimize display settings for different monitors

5

System administration

Configure display settings for multi-monitor setups

Learn By Doing

The best way to learn Linux commands is by practicing. Try out these examples in your terminal to build muscle memory and understand how the cvt command works in different scenarios.

$ cvt
View All Commands