#!/bin/sh set -e MAIN=$(xrandr | grep eDP | cut -f1 -d" ") if [ "${MAIN}" = "" ]; then echo "Could not find main display." exit 1 fi OTHER=$(xrandr | grep "\" | grep -v eDP | cut -f1 -d" ") if [ "${OTHER}" = "" ]; then echo "Could not find external display." exit 1 fi echo "Bring ${OTHER} right of ${MAIN}" xrandr --output ${MAIN} --auto --primary; xrandr --output ${OTHER} --auto; xrandr --output ${OTHER} --auto --right-of ${MAIN}