diff options
author | Romain Gonçalves <me@rgoncalves.se> | 2022-01-02 21:07:04 +0100 |
---|---|---|
committer | Romain Gonçalves <me@rgoncalves.se> | 2022-01-02 21:07:04 +0100 |
commit | a3d041d259756dc609b40e5244965fb36b05b8a3 (patch) | |
tree | 8f0890cf1dc48ef35ca6d0d5e572c2325aa09288 /.bin/ag-autorandr | |
parent | 0f08d04698c814955116b6bae50752e64b774d8f (diff) | |
download | dots-a3d041d259756dc609b40e5244965fb36b05b8a3.tar.gz |
Sun Jan 2 09:07:04 PM CET 2022
Diffstat (limited to '.bin/ag-autorandr')
-rwxr-xr-x | .bin/ag-autorandr | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/.bin/ag-autorandr b/.bin/ag-autorandr index 0a75819..1064e1c 100755 --- a/.bin/ag-autorandr +++ b/.bin/ag-autorandr @@ -1,14 +1,15 @@ #!/bin/sh -screens=$(xrandr --listmonitors | tail -n +2 | rev | cut -d " " -f 1 | rev) -screen_master=$(echo "${screens}" | cut -d " " -f 1) +set -x + +# screens=$(xrandr --listmonitors | tail -n +2 | rev | cut -d " " -f 1 | rev) +screens=$(xrandr -q | grep -v -e "^ " -e "disconnected" | tail -n +2 | cut -d " " -f 1) +screen_master=$(echo "${screens}" | head -n 1) -logger -s reset xrandr size xrandr -s 0 xrandr --output "${screen_master}" --auto -for screen in $(echo ${screens} | cut -d " " -f 2); do +for screen in ${screens}; do xrandr --output "${screen}" --auto --right-of "${screen_master}" - echo --output "${screen}" --auto --right-of "${screen_master}" - screen_master=${screen} + screen_master="${screen}" done |