summaryrefslogblamecommitdiffstats
path: root/.bin/ag-autorandr
blob: 1c4e325e53b5f6542b677a63981fa742b9656751 (plain) (tree)
1
2
3
4
5
6
7
8

         




                                                                                       
 


                                         
                            
                                                                        
                                 
    

                                     
#!/bin/sh

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)

xrandr -s 0
xrandr --output "${screen_master}" --auto

for screen in ${screens}; do
	xrandr --output "${screen}" --auto --right-of "${screen_master}"
	screen_master="${screen}"
done

xrandr --output "${screen}" --primary
remember that computers suck.