=== modified file 'xsession-skel/home/ccx/bin/autoxrandr' --- old/xsession-skel/home/ccx/bin/autoxrandr 2022-06-22 20:03:03 +0000 +++ new/xsession-skel/home/ccx/bin/autoxrandr 2021-03-12 20:27:22 +0000 @@ -1,29 +1,6 @@ #!/bin/sh # query output information with EDID using xrandr, format it into single line, match and apply rules. - -usage() { - printf "usage: autoxrandr [--dump]\n" - exit 2 -} - -match_line() { - case "$1" in - - # Tygr, větší monitor Samsung - ("HDMI1 connected 00ffffffffffff004c2dcb09353436301a19010380351e782a4ba1a359559b260e5054bfef80714f81c0810081809500a9c0b3000101023a801871382d40582c4500132b2100001e000000fd00384b1e5111000a202020202020000000fc00533234433435300a2020202020000000ff00483446473630363632360a2020016802010400023a80d072382d40102c4580132b2100001e011d007251d01e206e285500132b2100001e011d00bc52d01e20b8285540132b2100001e8c0ad090204031200c405500132b210000188c0ad08a20e02d10103e9600132b210000180000000000000000000000000000000000000000000000000000000000000000000e") - xrandr --output ${1%% *} --left-of LVDS1 - ;; - - # Doma, ViewSonic - ("HDMI1 connected 00ffffffffffff005a635120010101010312010380311d782ee525a65444a125145054bfef80b300a94081808140714f01010101010121399030621a274068b03600ef231100001c000000ff005154533038303330353833320a000000fd00324b1e5211000a202020202020000000fc00564132323236772d330a2020200072") - xrandr --output ${1%% *} --right-of LVDS1 --auto - ;; - - esac -} - -dump_edid() { xrandr --verbose | awk ' /^Screen /{ next } /^[^ \t]/{ cur_out=$1; out_conn[$1]=$2; next; } @@ -31,22 +8,13 @@ edid && /^\t\t[0-9a-f]{32}$/{ out_edid[cur_out]=out_edid[cur_out] $1; next } { edid=0 } END{ for(out in out_conn){ printf("%s %s %s\n", out, out_conn[out], out_edid[out]) } } -' -} +' | while IFS= read line; do + case "$line" in -case $# in - (0) ;; - (1) - if test "x--dump" = "x$1"; then - dump_edid - exit $? - else - usage - fi + # Tygr, větší monitor Samsung + ("HDMI1 connected 00ffffffffffff004c2dcb09353436301a19010380351e782a4ba1a359559b260e5054bfef80714f81c0810081809500a9c0b3000101023a801871382d40582c4500132b2100001e000000fd00384b1e5111000a202020202020000000fc00533234433435300a2020202020000000ff00483446473630363632360a2020016802010400023a80d072382d40102c4580132b2100001e011d007251d01e206e285500132b2100001e011d00bc52d01e20b8285540132b2100001e8c0ad090204031200c405500132b210000188c0ad08a20e02d10103e9600132b210000180000000000000000000000000000000000000000000000000000000000000000000e") + xrandr --output ${line%% *} --left-of LVDS1 ;; - (*) usage;; -esac -dump_edid | while IFS= read line; do - match_line "$line" + esac done