X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=laptop-xrandr;h=d57b43f1b6ec49f43d50a82e9a72036acb35ab54;hb=371c5fd6ded824eca8ff2b19b6dae8aede579347;hp=4a0891a99821c8d829689b61f28d754b115a21af;hpb=c91604aff2ce49bd4ce9b429b9e738286a319923;p=distro-setup diff --git a/laptop-xrandr b/laptop-xrandr index 4a0891a..d57b43f 100755 --- a/laptop-xrandr +++ b/laptop-xrandr @@ -22,16 +22,76 @@ set -e; . /usr/local/lib/bash-bear; set +e +xf=$(mktemp) +xrandr >$xf -output=$(xrandr | grep -E "^(HDMI.?|DP1) connected" | awk '{print $1}' ||:) +# eg eDP-1 connected primary +laptop_out=$(awk '$3 == "primary" {print $1}' $xf) +output=$(grep -E "^(HDMI|DP)[^ ]* connected [0-9]" $xf| awk '{print $1}' ||:) +edid() { + card=$1 + sha256sum /dev/null; then + xrandr --delmonitor BIG-$x + fi + done + xrandr --setmonitor BIG-LEFT $half_x/298x$y/336+0+$x_offset $output + xrandr --setmonitor BIG-RIGHT $half_x/298x$y/336+$(( x_offset + half_x ))+0 none + + + for i in 2 3 4 5 6 7 8 9 10; do + # if the workspace is already there, this will fail. + # if the workspace doesn't exist yet, it fails with: + # ERROR: No output matched i3-msg '[workspace="'$i'"]' move workspace to output $output ||: done else