X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=laptop-xrandr;h=d57b43f1b6ec49f43d50a82e9a72036acb35ab54;hb=eef2ed83fa84b3ac19533dfe0239cef4c2223143;hp=6701e74525d7c2203a4a03a5fc9c533596b04ec9;hpb=f27b67a1dfa58b5f101bba607b2f91a73e65299e;p=distro-setup diff --git a/laptop-xrandr b/laptop-xrandr index 6701e74..d57b43f 100755 --- a/laptop-xrandr +++ b/laptop-xrandr @@ -22,29 +22,73 @@ set -e; . /usr/local/lib/bash-bear; set +e +xf=$(mktemp) +xrandr >$xf + # eg eDP-1 connected primary -laptop_out=$(xrandr | awk '$3 == "primary" {print $1}') -output=$(xrandr | grep -E "^(HDMI|DP)[^ ]* connected [0-9]" | awk '{print $1}' ||:) +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