Skip to content

Commit

Permalink
- Rotation script, rotates screen clockwise
Browse files Browse the repository at this point in the history
- Default X screen settings
  • Loading branch information
jfwells committed Mar 1, 2014
1 parent 3336df0 commit ecf40aa
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rotation/home/user/Desktop/rotate.desktop
Original file line number Diff line number Diff line change
@@ -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;
26 changes: 26 additions & 0 deletions rotation/lib/udev/asus-t100ta-rotate.sh
Original file line number Diff line number Diff line change
@@ -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
30 changes: 30 additions & 0 deletions rotation/lib/udev/asus-t100ta-rotate.sh~
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions video/usr/share/X11/xorg.conf.d/50-1368x768
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ecf40aa

Please sign in to comment.