Skip to content

Commit

Permalink
Merge pull request #1227 from siiky/fix/lam-1230/cc-rotate-screens
Browse files Browse the repository at this point in the history
LAM-1230 fix: `calibrate-screen.sh`
  • Loading branch information
RafaelTaranto authored Nov 21, 2024
2 parents c92187e + b455711 commit fd8698c
Show file tree
Hide file tree
Showing 26 changed files with 578 additions and 215 deletions.
1 change: 1 addition & 0 deletions deploy/codebase/lamassu-machine-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ function updateSupervisor (cb) {

const commands = [
async.apply(command, `cp ${supervisorPath}/* /etc/supervisor/conf.d/`),
async.apply(command, `rm -f /etc/supervisor/conf.d/calibrate-screen.conf`),
async.apply(command, `sed -i 's|^user=.*\$|user=${osuser}|;' /etc/supervisor/conf.d/lamassu-browser.conf || true`)
]

Expand Down
40 changes: 32 additions & 8 deletions hardware/system/coincloud/jcm-ipro-rc/calibrate-screen.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
#!/usr/bin/env sh
xrandr -o left # normal, inverted, left, right
identityMat='1 0 0 0 1 0 0 0 1'
leftRotateMat='0 -1 1 1 0 0 0 0 1'
rightRotateMat='0 1 0 -1 0 1 0 0 1'
xinput set-prop 'ILITEK ILITEK-TP' --type=float 'Coordinate Transformation Matrix' $leftRotateMat
xset s off
xset s noblank
xset -dpms
set -e

### CHANGE CONFIGURATION AT THE END OF THE FILE ###

configure_screen() {
local rotation="$1"
case "${rotation}" in
normal) touchRotation='1 0 0 0 1 0 0 0 1';;
left) touchRotation='0 -1 1 1 0 0 0 0 1';;
right) touchRotation='0 1 0 -1 0 1 0 0 1';;
*) echo "Unknown rotation '${rotation}'..."; exit 1;;
esac
screenRotation="${rotation}"

xrandr -o "${screenRotation}" \
&& xset s off \
&& xset s noblank \
&& xset -dpms
}

configure_touch() {
local screen="$1"
xinput set-prop "${screen}" --type=float 'Coordinate Transformation Matrix' $touchRotation
}

### CHANGE CONFIGURATION BELOW TO MATCH THE CONNECTED SCREEN ###

# One of: normal, left, right
configure_screen left
# Find the screen name under "Virtual core pointer" of the following command:
# xinput list
configure_touch 'ILITEK ILITEK-TP'

This file was deleted.

40 changes: 32 additions & 8 deletions hardware/system/coincloud/mei-bnr/calibrate-screen.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
#!/usr/bin/env sh
xrandr -o left # normal, inverted, left, right
identityMat='1 0 0 0 1 0 0 0 1'
leftRotateMat='0 -1 1 1 0 0 0 0 1'
rightRotateMat='0 1 0 -1 0 1 0 0 1'
xinput set-prop 'ILITEK ILITEK-TP' --type=float 'Coordinate Transformation Matrix' $leftRotateMat
xset s off
xset s noblank
xset -dpms
set -e

### CHANGE CONFIGURATION AT THE END OF THE FILE ###

configure_screen() {
local rotation="$1"
case "${rotation}" in
normal) touchRotation='1 0 0 0 1 0 0 0 1';;
left) touchRotation='0 -1 1 1 0 0 0 0 1';;
right) touchRotation='0 1 0 -1 0 1 0 0 1';;
*) echo "Unknown rotation '${rotation}'..."; exit 1;;
esac
screenRotation="${rotation}"

xrandr -o "${screenRotation}" \
&& xset s off \
&& xset s noblank \
&& xset -dpms
}

configure_touch() {
local screen="$1"
xinput set-prop "${screen}" --type=float 'Coordinate Transformation Matrix' $touchRotation
}

### CHANGE CONFIGURATION BELOW TO MATCH THE CONNECTED SCREEN ###

# One of: normal, left, right
configure_screen left
# Find the screen name under "Virtual core pointer" of the following command:
# xinput list
configure_touch 'ILITEK ILITEK-TP'

This file was deleted.

40 changes: 32 additions & 8 deletions hardware/system/coincloud/mei-scr/calibrate-screen.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
#!/usr/bin/env sh
xrandr -o left # normal, inverted, left, right
identityMat='1 0 0 0 1 0 0 0 1'
leftRotateMat='0 -1 1 1 0 0 0 0 1'
rightRotateMat='0 1 0 -1 0 1 0 0 1'
xinput set-prop 'ILITEK ILITEK-TP' --type=float 'Coordinate Transformation Matrix' $leftRotateMat
xset s off
xset s noblank
xset -dpms
set -e

### CHANGE CONFIGURATION AT THE END OF THE FILE ###

configure_screen() {
local rotation="$1"
case "${rotation}" in
normal) touchRotation='1 0 0 0 1 0 0 0 1';;
left) touchRotation='0 -1 1 1 0 0 0 0 1';;
right) touchRotation='0 1 0 -1 0 1 0 0 1';;
*) echo "Unknown rotation '${rotation}'..."; exit 1;;
esac
screenRotation="${rotation}"

xrandr -o "${screenRotation}" \
&& xset s off \
&& xset s noblank \
&& xset -dpms
}

configure_touch() {
local screen="$1"
xinput set-prop "${screen}" --type=float 'Coordinate Transformation Matrix' $touchRotation
}

### CHANGE CONFIGURATION BELOW TO MATCH THE CONNECTED SCREEN ###

# One of: normal, left, right
configure_screen left
# Find the screen name under "Virtual core pointer" of the following command:
# xinput list
configure_touch 'ILITEK ILITEK-TP'

This file was deleted.

40 changes: 32 additions & 8 deletions hardware/system/generalbytes/batm3/calibrate-screen.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
#!/usr/bin/env sh
xrandr -o normal # normal, inverted, left, right
identityMat='1 0 0 0 1 0 0 0 1'
leftRotateMat='0 -1 1 1 0 0 0 0 1'
rightRotateMat='0 1 0 -1 0 1 0 0 1'
xinput set-prop 'Virtual core pointer' --type=float 'Coordinate Transformation Matrix' $identityMat
xset s off
xset s noblank
xset -dpms
set -e

### CHANGE CONFIGURATION AT THE END OF THE FILE ###

configure_screen() {
local rotation="$1"
case "${rotation}" in
normal) touchRotation='1 0 0 0 1 0 0 0 1';;
left) touchRotation='0 -1 1 1 0 0 0 0 1';;
right) touchRotation='0 1 0 -1 0 1 0 0 1';;
*) echo "Unknown rotation '${rotation}'..."; exit 1;;
esac
screenRotation="${rotation}"

xrandr -o "${screenRotation}" \
&& xset s off \
&& xset s noblank \
&& xset -dpms
}

configure_touch() {
local screen="$1"
xinput set-prop "${screen}" --type=float 'Coordinate Transformation Matrix' $touchRotation
}

### CHANGE CONFIGURATION BELOW TO MATCH THE CONNECTED SCREEN ###

# One of: normal, left, right
configure_screen normal
# Find the screen name under "Virtual core pointer" of the following command:
# xinput list
configure_touch 'Virtual core pointer'
40 changes: 32 additions & 8 deletions hardware/system/generalbytes/batm7in/calibrate-screen.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
#!/usr/bin/env sh
xrandr -o normal # normal, inverted, left, right
identityMat='1 0 0 0 1 0 0 0 1'
leftRotateMat='0 -1 1 1 0 0 0 0 1'
rightRotateMat='0 1 0 -1 0 1 0 0 1'
xinput set-prop 'ILITEK ILITEK-TP' --type=float 'Coordinate Transformation Matrix' $identityMat
xset s off
xset s noblank
xset -dpms
set -e

### CHANGE CONFIGURATION AT THE END OF THE FILE ###

configure_screen() {
local rotation="$1"
case "${rotation}" in
normal) touchRotation='1 0 0 0 1 0 0 0 1';;
left) touchRotation='0 -1 1 1 0 0 0 0 1';;
right) touchRotation='0 1 0 -1 0 1 0 0 1';;
*) echo "Unknown rotation '${rotation}'..."; exit 1;;
esac
screenRotation="${rotation}"

xrandr -o "${screenRotation}" \
&& xset s off \
&& xset s noblank \
&& xset -dpms
}

configure_touch() {
local screen="$1"
xinput set-prop "${screen}" --type=float 'Coordinate Transformation Matrix' $touchRotation
}

### CHANGE CONFIGURATION BELOW TO MATCH THE CONNECTED SCREEN ###

# One of: normal, left, right
configure_screen normal
# Find the screen name under "Virtual core pointer" of the following command:
# xinput list
configure_touch 'ILITEK ILITEK-TP'
40 changes: 32 additions & 8 deletions hardware/system/genmega/gemini/calibrate-screen.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
#!/usr/bin/env sh
xrandr -o left # normal, inverted, left, right
identityMat='1 0 0 0 1 0 0 0 1'
leftRotateMat='0 -1 1 1 0 0 0 0 1'
rightRotateMat='0 1 0 -1 0 1 0 0 1'
xinput set-prop 'ILITEK ILITEK-TP' --type=float 'Coordinate Transformation Matrix' $leftRotateMat
xset s off
xset s noblank
xset -dpms
set -e

### CHANGE CONFIGURATION AT THE END OF THE FILE ###

configure_screen() {
local rotation="$1"
case "${rotation}" in
normal) touchRotation='1 0 0 0 1 0 0 0 1';;
left) touchRotation='0 -1 1 1 0 0 0 0 1';;
right) touchRotation='0 1 0 -1 0 1 0 0 1';;
*) echo "Unknown rotation '${rotation}'..."; exit 1;;
esac
screenRotation="${rotation}"

xrandr -o "${screenRotation}" \
&& xset s off \
&& xset s noblank \
&& xset -dpms
}

configure_touch() {
local screen="$1"
xinput set-prop "${screen}" --type=float 'Coordinate Transformation Matrix' $touchRotation
}

### CHANGE CONFIGURATION BELOW TO MATCH THE CONNECTED SCREEN ###

# One of: normal, left, right
configure_screen left
# Find the screen name under "Virtual core pointer" of the following command:
# xinput list
configure_touch 'ILITEK ILITEK-TP'

This file was deleted.

42 changes: 33 additions & 9 deletions hardware/system/genmega/gmuk1/calibrate-screen.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
#!/usr/bin/env sh
xrandr -o left # normal, inverted, left, right
identityMat='1 0 0 0 1 0 0 0 1'
leftRotateMat='0 -1 1 1 0 0 0 0 1'
rightRotateMat='0 1 0 -1 0 1 0 0 1'
xinput set-prop 'Silicon Works Multi-touch Device' --type=float 'Coordinate Transformation Matrix' $leftRotateMat
xinput set-prop 'Silicon Works Multi-touch SW4101C' --type=float 'Coordinate Transformation Matrix' $leftRotateMat
xset s off
xset s noblank
xset -dpms
set -e

### CHANGE CONFIGURATION AT THE END OF THE FILE ###

configure_screen() {
local rotation="$1"
case "${rotation}" in
normal) touchRotation='1 0 0 0 1 0 0 0 1';;
left) touchRotation='0 -1 1 1 0 0 0 0 1';;
right) touchRotation='0 1 0 -1 0 1 0 0 1';;
*) echo "Unknown rotation '${rotation}'..."; exit 1;;
esac
screenRotation="${rotation}"

xrandr -o "${screenRotation}" \
&& xset s off \
&& xset s noblank \
&& xset -dpms
}

configure_touch() {
local screen="$1"
xinput set-prop "${screen}" --type=float 'Coordinate Transformation Matrix' $touchRotation
}

### CHANGE CONFIGURATION BELOW TO MATCH THE CONNECTED SCREEN ###

# One of: normal, left, right
configure_screen left
# Find the screen name under "Virtual core pointer" of the following command:
# xinput list
configure_touch 'Silicon Works Multi-touch Device'
configure_touch 'Silicon Works Multi-touch SW4101C'

This file was deleted.

Loading

0 comments on commit fd8698c

Please sign in to comment.