2014-01-08

script i use to swap between my laptop display and the hdmi connected monitor

Just putting this here so others can find it.


#!/bin/bash

# i ran `xrandr -q` to discover these values
IN="eDP1"
EXT="HDMI1"

if (xrandr | grep "$EXT" | grep "+")
then
xrandr --output $EXT --off --output $IN --auto
else
  if (xrandr | grep "$EXT" | grep " connected")
    then
    xrandr --output $IN --off --output $EXT --auto
  fi
fi