X-Git-Url: https://git.sthu.org/?p=shutils.git;a=blobdiff_plain;f=X%2Fxrandr-single;fp=X%2Fxrandr-single;h=174a0df6cee9ad0abc4fb8670835ee807a7e5347;hp=0000000000000000000000000000000000000000;hb=336c7c24f3e51c309450450fc2e1304960a14a09;hpb=9b52797ddadf989219c0f1677ee4f403a1e31030 diff --git a/X/xrandr-single b/X/xrandr-single new file mode 100755 index 0000000..174a0df --- /dev/null +++ b/X/xrandr-single @@ -0,0 +1,21 @@ +#!/bin/sh + +set -e + +MAIN=$(xrandr | grep eDP | cut -f1 -d" ") +if [ "${MAIN}" = "" ]; then + echo "Could not find main display." + exit 1 +fi + +echo "Set ${MAIN} as primary" +xrandr --output ${MAIN} --auto --primary + +OTHER=$(xrandr | grep "\" | grep -v eDP | cut -f1 -d" ") +if [ "${OTHER}" = "" ]; then + echo "Could not find external display." + exit 1 +fi + +echo "Set ${OTHER} off" +xrandr --output ${OTHER} --off