Skip to content

Commit

Permalink
Add hacks to screen layout to make it work with the dell screens
Browse files Browse the repository at this point in the history
  • Loading branch information
keymon committed Mar 17, 2016
1 parent 485de5e commit d5d2bea
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bin/screen-layout
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
set -e

MAIN_SCREEN=LVDS1
MAIN_SCREEN_RESOLUTION=$(xrandr | grep $MAIN_SCREEN | sed -n 's/.* \([0-9]\+x[0-9]\+\)+.*/\1/p')
MAIN_SCREEN_RESOLUTION_AND_PANNING=$(xrandr | grep $MAIN_SCREEN | sed -n 's/.* \([0-9]\+x[0-9]\++[0-9]\++[0-9]\+\).*/\1/p')
MAIN_SCREEN_RESOLUTION=1920x1080
#MAIN_SCREEN_RESOLUTION=$(xrandr | grep $MAIN_SCREEN | sed -n 's/.* \([0-9]\+x[0-9]\+\)+.*/\1/p')
#MAIN_SCREEN_RESOLUTION_AND_PANNING=$(xrandr | grep $MAIN_SCREEN | sed -n 's/.* \([0-9]\+x[0-9]\++[0-9]\++[0-9]\+\).*/\1/p')

connected_screens() {
xrandr | sed -n 's/\([-a-zA-Z0-9]\+\) connected.*/\1/p' | grep -v "$MAIN_SCREEN" | xargs
Expand All @@ -20,11 +21,16 @@ else
select MODE in mirror above; do
case $MODE in
mirror)
xrandr --output $screen --off
xrandr --output $screen --auto
xrandr --output $MAIN_SCREEN --primary --auto --same-as $screen --mode $MAIN_SCREEN_RESOLUTION
;;
above)
xrandr --nograb --output $screen --panning 0x0+0+0
xrandr --output $MAIN_SCREEN --primary --auto --below $screen --auto
screen_resolution=$(xrandr | grep $screen | sed -n 's/.* \([0-9]\+x[0-9]\+\)+.*/\1/p')
xrandr --nograb --output $screen --mode $screen_resolution
# xrandr --nograb --output $screen --panning 0x0+0+0
xrandr --nograb --output $screen --panning $screen_resolution+0+0/0x0+0+0/0/0/0/-1200
xrandr --output $MAIN_SCREEN --primary --auto --below $screen --panning 0x0+0+0/0x0+0+0 # --auto
;;
esac
exit 0
Expand Down

0 comments on commit d5d2bea

Please sign in to comment.