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

33 lines
830 B
Bash

#!/bin/bash
# configure the display names with "xrandr"
LAPTOP=LVDS1
ANALOG=VGA1
DIGITAL=HDMI1
# You hay have to change ANALOG/DIGITAL in the outputs, especially for Workstation choices
if [ -z "$1" ]
then
echo 'Choose display mode:
1) Laptop only
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 $ANALOG --auto --right-of $LAPTOP ;;
4) xrandr --output $LAPTOP --off --output $ANALOG --auto ;;
esac