Files
q-tools/skel/disp
2014-04-14 13:16:13 +03:00

32 lines
741 B
Bash

#!/bin/bash
# configure the display names with "xrandr"
LAPTOP=LVDS1
ANALOG=VGA1
DIGITAL=HDMI1
if [ -z "$1" ]
then
echo 'Choose display mode:
1) Laptop auto
2) Presentation (2nd arg for gamma correction)
3) Workstation with 2nd screen
4) External display only
'
read i
else
i=$1
fi
if [ -z "$2" ]
then g=1
else g=$2
fi
case $i in
1) xrandr --output $LAPTOP --auto --gamma $g:$g:$g --output $ANALOG --off --output $DIGITAL --off ;;
2) xrandr --output $LAPTOP --mode 1024x768 --pos 0x0 --output $ANALOG --mode 1024x768 --pos 0x0 --gamma $g:$g:$g ;;
3) xrandr --output $LAPTOP --auto --output $DIGITAL --auto --right-of $LAPTOP ;;
4) xrandr --output $LAPTOP --off --output $DIGITAL --auto ;;
esac