Created
May 10, 2016 12:09
-
-
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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