X-Git-Url: https://git.sthu.org/?p=shutils.git;a=blobdiff_plain;f=X%2Fxrandr-exttoright;fp=X%2Fxrandr-exttoright;h=fca0aa6db46e1332dac7b8c32a51f551812c3855;hp=0000000000000000000000000000000000000000;hb=336c7c24f3e51c309450450fc2e1304960a14a09;hpb=9b52797ddadf989219c0f1677ee4f403a1e31030 diff --git a/X/xrandr-exttoright b/X/xrandr-exttoright new file mode 100755 index 0000000..fca0aa6 --- /dev/null +++ b/X/xrandr-exttoright @@ -0,0 +1,19 @@ +#!/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}