]>
git.sthu.org Git - shutils.git/blob - lenovo-x220-linuxacpi/etc/acpi/actions/btn-vga.sh
3 .
/usr
/local
/bin
/getXenv.inc
6 STATEFILE
="/var/run/vgastate"
7 LVDS1_defaultmode
="1366x768"
11 logger
"Turn external video off, putting LVDS1 to standard setup"
12 xrandr
--output VGA1
--off \
13 --output HDMI2
--off \
14 --output LVDS1
--primary --mode $LVDS1_defaultmode --scale 1x1
15 echo "vgaoff" > $STATEFILE
20 logger
"Mirror LVDS1 to $1"
21 xrandr
--output $1 --primary --auto \
22 --output LVDS1
--mode 1024x768
--same-as VGA1
23 echo "vgamirror" > $STATEFILE
28 logger
"Putting $1 right of of LVDS1"
29 xrandr
--output LVDS1
--primary --auto --mode $LVDS1_defaultmode \
30 --output $1 --auto --right-of LVDS1
31 echo "vgarightof" > $STATEFILE
36 logger
"Putting $1 left of of LVDS1"
37 xrandr
--output LVDS1
--primary --auto --mode $LVDS1_defaultmode \
38 --output $1 --auto --left-of LVDS1
39 echo "vgaleftof" > $STATEFILE
44 xrandr |
grep "VGA1 connected" && extconn
="VGA1"
45 xrandr |
grep "HDMI2 connected" && extconn
="HDMI2"
47 if [ -n "$extconn" ]; then
48 case `cat $STATEFILE 2> /dev/null` in