#!/bin/bash IN="LVDS1" EXT="VGA1" if ( xrandr | grep -q "$EXT disconnected") then xrandr --output $IN --auto --output $EXT --off else xrandr --output $IN --auto --primary --output $EXT --auto --right-of $IN ## Only VGA # xrandr --output $IN --mode 1366x768 # xrandr --output $EXT --mode 1366x768 --right-of $IN fi