From ecf40aa716f18aa006e77daf9ae5a63a2c4a44d2 Mon Sep 17 00:00:00 2001 From: John Wells Date: Sun, 2 Mar 2014 01:56:51 +0800 Subject: [PATCH] - Rotation script, rotates screen clockwise - Default X screen settings --- rotation/home/user/Desktop/rotate.desktop | 10 +++++++ rotation/lib/udev/asus-t100ta-rotate.sh | 26 ++++++++++++++++++ rotation/lib/udev/asus-t100ta-rotate.sh~ | 30 +++++++++++++++++++++ video/usr/share/X11/xorg.conf.d/50-1368x768 | 15 +++++++++++ 4 files changed, 81 insertions(+) create mode 100755 rotation/home/user/Desktop/rotate.desktop create mode 100755 rotation/lib/udev/asus-t100ta-rotate.sh create mode 100755 rotation/lib/udev/asus-t100ta-rotate.sh~ create mode 100644 video/usr/share/X11/xorg.conf.d/50-1368x768 diff --git a/rotation/home/user/Desktop/rotate.desktop b/rotation/home/user/Desktop/rotate.desktop new file mode 100755 index 0000000..773c164 --- /dev/null +++ b/rotation/home/user/Desktop/rotate.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Rotate +Comment=Rotate the screen +Keywords=rotate;screen; +Exec=/lib/udev/asus-t100ta-rotate.sh +Terminal=true +Type=Application +Icon=rotation-allowed-symbolic +StartupNotify=true +Categories=System; diff --git a/rotation/lib/udev/asus-t100ta-rotate.sh b/rotation/lib/udev/asus-t100ta-rotate.sh new file mode 100755 index 0000000..11e5249 --- /dev/null +++ b/rotation/lib/udev/asus-t100ta-rotate.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +TOUCHSCREEN=`xinput | grep ATML1000 | cut -f2 | cut -d= -f2` +CURR_ROT=`xrandr -q --verbose | grep VGA | cut -d" " -f 6` + +if [ "$CURR_ROT" == "normal" ]; then + ROT_TO="right" + SWAP_TO="1" + INV_TO="0, 1" +elif [ "$CURR_ROT" == "right" ]; then + ROT_TO="inverted" + SWAP_TO="0" + INV_TO="1, 1" +elif [ "$CURR_ROT" == "inverted" ]; then + ROT_TO="left" + SWAP_TO="1" + INV_TO="1, 0" +else + ROT_TO="normal" + SWAP_TO="0" + INV_TO="0, 0" +fi + +xrandr --screen 0 -o $ROT_TO +xinput set-int-prop $TOUCHSCREEN "Evdev Axis Inversion" 8 $INV_TO +xinput set-int-prop $TOUCHSCREEN "Evdev Axes Swap" 8 $SWAP_TO diff --git a/rotation/lib/udev/asus-t100ta-rotate.sh~ b/rotation/lib/udev/asus-t100ta-rotate.sh~ new file mode 100755 index 0000000..c46db43 --- /dev/null +++ b/rotation/lib/udev/asus-t100ta-rotate.sh~ @@ -0,0 +1,30 @@ +#!/bin/bash + +TOUCHSCREEN=`xinput | grep ATML1000 | cut -f2 | cut -d= -f2` +CURR_ROT=`xrandr -q --verbose | grep VGA | cut -d" " -f 6` + +# 1 1 x wrong y right +# 1 0, 0, 1 x wrong y wrong + + +if [ "$CURR_ROT" == "normal" ]; then + ROT_TO="right" + SWAP_TO="1" + INV_TO="0, 1" +elif [ "$CURR_ROT" == "right" ]; then + ROT_TO="inverted" + SWAP_TO="0" + INV_TO="1, 1" +elif [ "$CURR_ROT" == "inverted" ]; then + ROT_TO="left" + SWAP_TO="1" + INV_TO="1, 0" +else + ROT_TO="normal" + SWAP_TO="0" + INV_TO="0, 0" +fi + +xrandr --screen 0 -o $ROT_TO +xinput set-int-prop $TOUCHSCREEN "Evdev Axis Inversion" 8 $INV_TO +xinput set-int-prop $TOUCHSCREEN "Evdev Axes Swap" 8 $SWAP_TO diff --git a/video/usr/share/X11/xorg.conf.d/50-1368x768 b/video/usr/share/X11/xorg.conf.d/50-1368x768 new file mode 100644 index 0000000..cd02660 --- /dev/null +++ b/video/usr/share/X11/xorg.conf.d/50-1368x768 @@ -0,0 +1,15 @@ +Section "Device" + Identifier "Configured Video Device" +EndSection + +Section "Monitor" + Identifier "Configured Monitor" + ModeLine "1368x768_60.00" 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync + Option "PreferredMode" "1368x768_60.00" +EndSection + +Section "Screen" + Identifier "Configured Screen" + Monitor "Configured Monitor" + Device "Configured Video Device" +EndSection