#!/bin/sh

# TODO: handle HDMI-3 / 4 / 5
# by betabug

case "$1" in
"mirror")
    xrandr --output VGA --same-as LVDS
    ;;
"external")
    xrandr --output LVDS --off --output VGA --auto
    ;;
"off")
    # external monitor is off, internal on
    xrandr --output LVDS --auto --output VGA --off
    ;;
"right")
    xrandr --output VGA --auto --right-of LVDS
    ;;
"left")
    xrandr --output VGA --auto --left-of LVDS
    ;;
*)
    # default fall through ...
    # external monitor is off, internal on
    xrandr --output LVDS --auto --output VGA --off
    ;;
esac