#!/bin/bash

DEFPORT=VGA1
if [ "$HOSTNAME" == tx ]; then DEFPORT=HDMI1; fi


PORT=$2
[ -z "$PORT" ] && PORT=$DEFPORT
echo dock $1 $PORT

[ -z "$1" ] && echo "usage: $0 <on/off> [<port>]" && exit 1

on() {
    xrandr --output $PORT --auto
    xmodmap ~/dot/Xmodmap.ctrl
}

off() {
    xrandr --output $PORT --off
    xrandr --output LVDS1 --auto
}

$1

# This will also configure USB keyboard.
xmodmap ~/dot/Xmodmap.ctrl

