Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Configure my Dell monitor (EDID not auto-recognised) via VGA manually with xrandr
#!/bin/sh
# 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..."
else
echo "Adding monitor config modeline from cvt output..."
xrandr --newmode ${modeline}
xrandr --addmode VGA1 ${modeline_name}
fi
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