2 # Copyright 2009 Nicolas Bigaouette
3 # This file is part of acpi-eeepc-generic.
4 # http://code.google.com/p/acpi-eeepc-generic/
6 # acpi-eeepc-generic is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # acpi-eeepc-generic is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with acpi-eeepc-generic. If not, see <http://www.gnu.org/licenses/>.
21 # Tool to rotate LVDS panel
24 .
/etc
/acpi
/eeepc
/acpi-eeepc-generic-functions.sh
26 var_xrandr
="$EEEPC_VAR/xrandr.log"
29 name_lvds
=$
(grep -i connected
$var_xrandr |
grep -i lvds |
awk '{print ""$1""}')
31 function rotate_toggle
{
32 CURRENT
=`xrandr | grep LVDS | awk '{print $4}'`
33 if [ "$CURRENT" = "right" ]; then
35 elif [ "$CURRENT" = "inverted" ]; then
37 elif [ "$CURRENT" = "left" ]; then
42 if [ "$ROTATION" ]; then
43 rotate_lvds
"$ROTATION"
44 echo "$ROTATION" > $EEEPC_VAR/rotation_saved
48 function restore_rotation
{
49 if [ -e "$EEEPC_VAR/rotation_saved" ]; then
50 ROTATION
=$
(cat $EEEPC_VAR/rotation_saved
)
51 rotate_lvds
"$ROTATION"
55 function rotate_lvds
{
56 eeepc_notify
"Rotate LCD \"$1\"" screen
57 xrandr
--output ${name_lvds} --rotate "$1"