Skip to content

Instantly share code, notes, and snippets.

@lhotari
Created May 24, 2013 13:16
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lhotari/5643432 to your computer and use it in GitHub Desktop.
Save lhotari/5643432 to your computer and use it in GitHub Desktop.
script for adding standard modes to beamer for presenting on linux
#!/bin/bash
# script for adding standard modes to beamer for presenting on linux
# use xrandr to find out screen name of external output port
# xrandr is in x11-xserver-utils package on debian/ubuntu
SCREENNAME=$1
if [ -z "$SCREENNAME" ]; then
SCREENNAME=VGA-0
fi
function addmode() {
xrandr --newmode `cvt $1 $2 |grep Modeline | sed -e 's/^Modeline //' | sed -e 's/\"//g'`
xrandr --addmode $SCREENNAME $1x$2_60.00
}
addmode 1280 1024
addmode 1024 768
addmode 800 600
#addmode 1920 1200
@lhotari
Copy link
Author

lhotari commented May 24, 2013

I think the monitor has to be connected before running the script. You can check with xrandr command if it was able to add the forced modes.

@lhotari
Copy link
Author

lhotari commented May 24, 2013

Probably doesn't work for me anymore. I have Nvidia 310.44 driver version and it seems to have an incompatible xrandr version on Ubuntu 12.04.

@lhotari
Copy link
Author

lhotari commented May 25, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment