Wileyfox Swift rotate and autorotate fix
Signed-off-by: Stacy Harper <contact@stacyharper.net>
This commit is contained in:
parent
f60ef805bc
commit
5741f0692c
3 changed files with 15 additions and 8 deletions
|
@ -5,10 +5,10 @@
|
|||
. "$(dirname "$0")/sxmo_common.sh"
|
||||
|
||||
applyptrmatrix() {
|
||||
PTRID="$(
|
||||
xinput | grep -iE 'touchscreen.+pointer' | grep -oE 'id=[0-9]+' | cut -d= -f2
|
||||
)"
|
||||
xinput set-prop "$PTRID" --type=float --type=float "Coordinate Transformation Matrix" "$@"
|
||||
TOUCH_POINTER_ID="${TOUCH_POINTER_ID:-
|
||||
(xinput | grep -iE 'touchscreen.+pointer' | grep -oE 'id=[0-9]+' | cut -d= -f2)
|
||||
}"
|
||||
xinput set-prop "$TOUCH_POINTER_ID" --type=float --type=float "Coordinate Transformation Matrix" "$@"
|
||||
}
|
||||
|
||||
isrotated() {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#!/usr/bin/env sh
|
||||
GRAVITY="16374"
|
||||
THRESHOLD="400"
|
||||
ROTATION_GRAVITY="${ROTATION_GRAVITY:-"16374"}"
|
||||
ROTATION_THRESHOLD="${ROTATION_THRESHOLD:-"400"}"
|
||||
POLL_TIME=1
|
||||
RIGHT_SIDE_UP="$(echo "$GRAVITY - $THRESHOLD" | bc)"
|
||||
UPSIDE_DOWN="$(echo "-$GRAVITY + $THRESHOLD" | bc)"
|
||||
RIGHT_SIDE_UP="$(echo "$ROTATION_GRAVITY - $ROTATION_THRESHOLD" | bc)"
|
||||
UPSIDE_DOWN="$(echo "-$ROTATION_GRAVITY + $ROTATION_THRESHOLD" | bc)"
|
||||
FILE_Y="$(find /sys/bus/iio/devices/iio:device*/ -iname in_accel_y_raw)"
|
||||
FILE_X="$(find /sys/bus/iio/devices/iio:device*/ -iname in_accel_x_raw)"
|
||||
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Wileyfox Swift (wileyfox-crackling)
|
||||
|
||||
export BATTERY_DEVICE="/sys/class/power_supply/pm8916-bms-vm"
|
||||
|
||||
export TOUCH_POINTER_ID="10"
|
||||
|
||||
export ROTATION_GRAVITY="500"
|
||||
export ROTATION_THRESHOLD="60"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue