#!/bin/sh # LENOVO S10-3t CHANGE ==> Hard Coded my device number to 11!!!!!!!! # find out with xinput --list --short device=11 orientation=0 current_orientation="$(xrandr -q --verbose | grep 'connected' | egrep -o '\) (normal|left|inverted|right) \(' | egrep -o '(normal|left|inverted|right)')" case $current_orientation in normal) current_orientation=0 ;; left) current_orientation=1 ;; inverted) current_orientation=2 ;; right) current_orientation=3 ;; esac if [ $current_orientation -eq 0 ]; then orientation=1 fi if [ $current_orientation -eq 1 ]; then orientation=0 fi swap=0 invert_x=0 invert_y=0 real_topx=0 real_topy=0 real_bottomx=4020 real_bottomy=4020 case $orientation in 0) swap=0 invert_x=0 invert_y=0 topx=$real_topx topy=$real_topy bottomx=$real_bottomx bottomy=$real_bottomy ;; 1) swap=1 invert_x=1 invert_y=0 topx=$real_topx topy=$real_topy bottomx=$real_bottomy bottomy=$real_bottomx ;; esac xinput set-prop "$device" "Evdev Axes Swap" $swap xinput set-prop "$device" "Evdev Axis Inversion" $invert_x $invert_y xinput set-prop "$device" "Evdev Axis Calibration" $topx $bottomx $topy $bottomy if [ $orientation = 0 ]; then xrandr -o normal fi if [ $orientation = 1 ]; then xrandr -o left fi fi #