updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / acpi-eee1000 / buttonres.sh
blobe3730abb34f89620cb4b33fbb776596b370d703d
1 #!/bin/bash
3 source /etc/acpi/eee.conf
4 source /etc/acpi/eee/user && x_user_func
6 if [ -n "`/usr/bin/xset -display :0.0 -q | grep -e ' Monitor is Off'`" ]
7 then
8 xset -display :0.0 dpms force on || exit 1
9 fi
11 # LCD only
12 if [ -n "`xrandr | grep 'VGA disconnected'`" ] || [ -n "`xrandr | grep 'VGA connected (normal'`" ]
13 then
14 if [ -n "`xrandr | grep 'current 1024 x 600'`" ]
15 then
16 xrandr --output LVDS --mode 800x600 || exit 1
17 else
18 xrandr --output LVDS --mode 1024x600 || exit 1
20 # CRT only
21 elif [ -n "`xrandr | grep 'LVDS connected (normal'`" ]
22 then
23 if [ -n "`xrandr | grep 'current 1024 x 768'`" ]
24 then
25 xrandr --output VGA --mode 800x600 || exit 1
26 else
27 xrandr --output VGA --mode 1024x768 || exit 1
29 else
30 if [ -n "`xrandr | grep 'current 1024 x 600'`" ]
31 then
32 xrandr --output VGA --mode 800x600 --output LVDS --mode 800x600 || exit 1
33 else
34 xrandr --output VGA --mode 1024x600 --output LVDS --mode 1024x600 || exit 1
38 exit 0