#!/bin/bash
#
# nixpunk 
# Oct-2012
# set xrandr for Thinkpad built-in or external monitor
#

if [ "$#" == 0 ]; then 
    xrandr --output LVDS1 --auto --output VGA1 --off  
elif [ "$1" == "-d" ]; then
    xrandr --output LVDS1 --off --output VGA1 --auto
elif [ "$1" == "-e" ]; then
    xrandr --output LVDS1 --off --output VGA1 --auto
elif [ "$1" == "-m" ]; then
    xrandr --output LVDS1 --auto --output VGA1 --auto
else
    echo "Usage: monset <option>" 
    echo " -d: reset to use built-in monitor (same as 'monset' with no opts)"
    echo " -e: use external monitor with built-in disabled"
    echo " -m: use external monitor mirrored with built-in"
    exit 1
fi

exit 0

