How-to-simply...

Add custom display resolution for X11 VNC sessions

  • 1 Get correct VNC-{NUMBER}
    xrandr | grep -o 'VNC-[0-9]+'
  • 2 Determine new mode options
    cvp -v -r 1872 940 60
  • 3 vim /etc/profile.d/add-display-resolutions.sh
    #!/bin/bash
    if [ -n "$DISPLAY" ] && ! xrandr --query | grep -q "VNC-{NUMBER}"; then
    : # No-op, only affecting VNC sessions
    else
    MODE_NAME_01="1872x940R"
    if [ -n "$DISPLAY" ] && ! xrandr | grep -q "${MODE_NAME_01}"; then
    xrandr --newmode "1872x940R" 117.75 1872 1920 1952 2032 940 943 953 967 +hsync -vsync
    xrandr --addmode VNC-{NUMBER} "${MODE_NAME_01}"
    fi
    fi

References