Created
May 22, 2019 11:38
-
-
Save nvlled/0a3c611862cb597722c05350bf61c276 to your computer and use it in GitHub Desktop.
Adds a temporary monitor resolution (linux)
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/bash | |
# example usage: | |
# ./add-monitor-resolution.sh VGA-1 1920 1080 | |
# Note: replace VGA-1 with the name of your device | |
# run `xrandr --list-monitors` to see the name of your device | |
monitor=$1 | |
width=$2 | |
height=$3 | |
modeline=`cvt $width $height | tail -n1 | cut --complement -d" " -f 1` | |
res=`echo $modeline | cut -d" " -f 1` | |
xrandr --newmode $modeline | |
xrandr --addmode VGA-1 $res |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment