Created
December 4, 2022 14:31
-
-
Save chirvo/88ac1bd66a357430216013e5622130dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# to hide the cursor on the touchscreen you need to run unclutter-xfixes ver 1.6 or greater | |
# use the option --hide-on-touch to achieve it. | |
XINPUT=/usr/bin/xinput | |
XRANDR=/usr/bin/xrandr | |
PORT=$($XRANDR | grep -w connected | grep "1920x1080" | cut -f1 -d' ') | |
ILITEK_TP_ID=$($XINPUT | grep ILITEK | grep -v Mouse | cut -f2 | cut -f2 -d=) | |
ILITEK_MOUSE_ID=$($XINPUT | grep ILITEK | grep Mouse | cut -f2 | cut -f2 -d=) | |
$XINPUT map-to-output $ILITEK_TP_ID $PORT | |
$XINPUT map-to-output $ILITEK_MOUSE_ID $PORT | |
if [ "$($XINPUT | grep Touchscreen)" == "" ]; | |
then | |
$XINPUT create-master Touchscreen | |
fi | |
TOUCHSCREEN_ID=$($XINPUT | grep "Touchscreen pointer" | cut -f2 -d= | cut -f1) | |
xinput | grep "Touchscreen pointer" | cut -f2 -d= | cut -f1 | |
echo "... $TOUCHSCREEN_ID ..." | |
$XINPUT reattach $ILITEK_TP_ID $TOUCHSCREEN_ID | |
$XINPUT reattach $ILITEK_MOUSE_ID $TOUCHSCREEN_ID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment