Skip to content

Instantly share code, notes, and snippets.

@cuadue
Created March 12, 2014 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cuadue/9513604 to your computer and use it in GitHub Desktop.
Save cuadue/9513604 to your computer and use it in GitHub Desktop.
Set the X11 resolution
#!/usr/bin/bash
# For example, to set 1920x1080 at 60Hz:
# . 1920 1080 60
MODE=$(cvt $* | tail -n1)
NAME=$(echo $MODE | cut -d' ' -f2 | sed 's/"//g')
MODELINE=$(echo $MODE | cut -d' ' -f3-)
xrandr --newmode "$NAME" $MODELINE > /dev/null 2>&1
xrandr --addmode VBOX0 $NAME > /dev/null 2>&1
xrandr --output VBOX0 --mode $NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment