X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=laptop-xrandr;h=4a0891a99821c8d829689b61f28d754b115a21af;hb=refs%2Fheads%2Fmaster;hp=417c9f7694d71c7d9b3c956e197e031af53cf39b;hpb=50f25d1eec109c4596cfc638c9a7c98da0f0b5d0;p=distro-setup diff --git a/laptop-xrandr b/laptop-xrandr index 417c9f7..28c840e 100755 --- a/laptop-xrandr +++ b/laptop-xrandr @@ -23,18 +23,27 @@ set -e; . /usr/local/lib/bash-bear; set +e -output=HDMI2 -output=DP1 - -if xrandr | grep -q "^$output disconnected" &>/dev/null; then - xrandr --auto -else +output=$(xrandr | grep -E "^(HDMI.?|DP1) connected" | awk '{print $1}' ||:) + +left_right_arg=--right-of +if [[ $output ]]; then + + if [[ $output == HDMI2 ]]; then + sum=$(sha256sum