Skip to content

Instantly share code, notes, and snippets.

Created May 10, 2016 12:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save hjst/0be1d17deb51f0312f0221ee4d4967b4 to your computer and use it in GitHub Desktop.
Configure my Dell monitor (EDID not auto-recognised) via VGA manually with xrandr
# This cvt command calculates the modeline for a 1920×1080 display @ 60Hz
modeline=`cvt 1920 1080 60 | tail -n 1 | cut -d ' ' -f 2-`
modeline_name=`echo ${modeline} | cut -d '"' -f 2`
if xrandr | grep ${modeline_name} > /dev/null; then
# Mode already exists (probably didn't reboot yet) so don't add it
echo "Monitor already configured, skipping..."
echo "Adding monitor config modeline from cvt output..."
xrandr --newmode ${modeline}
xrandr --addmode VGA1 ${modeline_name}
echo "Switching modes..."
xrandr --output VGA1 --mode ${modeline_name}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment