#!/bin/bash

XRANDR="/usr/bin/xrandr"

CONSTAT=$($XRANDR | grep "VGA1 connected")

if [[ "$CONSTAT" == "" ]] ; then
  #echo "Kein externes Display"
  exit 0
else # echo "Externes Display gefunden"
  $XRANDR --output LVDS1 --primary
  $XRANDR --output LVDS1 --mode 1024x768
  $XRANDR --output VGA1 --mode 1024x768
  $XRANDR --output VGA1 --same-as LVDS1
  exit 0
fi
