touchscreen: add-on removed
drop obsolete add-on
@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<addon id="@PKG_ADDON_ID@"
|
||||
name="@ADDON_NAME@"
|
||||
version="@ADDON_VERSION@"
|
||||
provider-name="@PROVIDER_NAME@">
|
||||
<requires>
|
||||
<import addon="xbmc.python" version="3.0.0"/>
|
||||
@REQUIRES@
|
||||
</requires>
|
||||
<extension point="xbmc.service" library="service.py">
|
||||
<provides></provides>
|
||||
</extension>
|
||||
<extension point="xbmc.python.pluginsource" library="calibrate.py">
|
||||
<provides>executable</provides>
|
||||
</extension>
|
||||
<extension point="xbmc.addon.metadata">
|
||||
<summary>@PKG_SHORTDESC@</summary>
|
||||
<description>
|
||||
@PKG_LONGDESC@
|
||||
</description>
|
||||
<disclaimer>
|
||||
@PKG_DISCLAIMER@
|
||||
</disclaimer>
|
||||
<platform>all</platform>
|
||||
<news>
|
||||
@PKG_ADDON_NEWS@
|
||||
</news>
|
||||
<assets>
|
||||
<icon>resources/icon.png</icon>
|
||||
<fanart>resources/fanart.png</fanart>
|
||||
@PKG_ADDON_SCREENSHOT@
|
||||
</assets>
|
||||
</extension>
|
||||
</addon>
|
@ -1 +0,0 @@
|
||||
initial release
|
Before Width: | Height: | Size: 29 KiB |
@ -3,33 +3,24 @@
|
||||
|
||||
PKG_NAME="touchscreen"
|
||||
PKG_VERSION="1.0"
|
||||
PKG_REV="0"
|
||||
PKG_REV="1"
|
||||
PKG_ARCH="any"
|
||||
PKG_ADDON_PROJECTS="Generic RPi ARM"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE=""
|
||||
PKG_URL=""
|
||||
PKG_DEPENDS_TARGET="toolchain tslib evtest"
|
||||
PKG_DEPENDS_TARGET="toolchain"
|
||||
PKG_SECTION="service"
|
||||
PKG_SHORTDESC="Touchscreen: support addon for Touchscreens"
|
||||
PKG_LONGDESC="Touchscreen: addon creates new virtual input device and \
|
||||
converts data from touchscreen to Kodi. Short tap sends button press event \
|
||||
and long tap sends only xy coordinates. Also includes calibration program."
|
||||
PKG_SHORTDESC="Add-on removed"
|
||||
PKG_LONGDESC="Add-on removed"
|
||||
PKG_TOOLCHAIN="manual"
|
||||
|
||||
PKG_ADDON_BROKEN="Touchscreen no longer required thus removed."
|
||||
|
||||
PKG_IS_ADDON="yes"
|
||||
PKG_ADDON_NAME="Touchscreen"
|
||||
PKG_ADDON_TYPE="xbmc.service"
|
||||
PKG_ADDON_TYPE="xbmc.broken"
|
||||
|
||||
addon() {
|
||||
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
|
||||
|
||||
cp ${PKG_DIR}/addon.xml ${ADDON_BUILD}/${PKG_ADDON_ID}
|
||||
|
||||
# set only version (revision will be added by buildsystem)
|
||||
sed -e "s|@ADDON_VERSION@|${ADDON_VERSION}|g" \
|
||||
-i ${ADDON_BUILD}/${PKG_ADDON_ID}/addon.xml
|
||||
|
||||
cp $(get_install_dir tslib)/usr/bin/* ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
|
||||
cp $(get_install_dir evtest)/usr/bin/evtest ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
|
||||
:
|
||||
}
|
||||
|
@ -1,65 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
. /etc/profile
|
||||
|
||||
oe_setup_addon service.touchscreen
|
||||
|
||||
if [ -d /usr/share/kodi/addons/service.touchscreen ]; then
|
||||
# addon included in image
|
||||
ADDON_DIR="/usr/share/kodi/addons/service.touchscreen"
|
||||
fi
|
||||
|
||||
. $ADDON_DIR/bin/ts_env.sh
|
||||
|
||||
echo "touchscreen device: $TSLIB_TSDEVICE"
|
||||
|
||||
if [ "$1" = "service" ]; then
|
||||
# recalibrate from service if required
|
||||
SETTINGS_XML="$ADDON_HOME/settings.xml"
|
||||
if [ -f "$SETTINGS_XML" ]; then
|
||||
mkdir -p /var/config
|
||||
|
||||
# check settings version
|
||||
XML_SETTINGS_VER="$(xmlstarlet sel -t -m settings -v @version $SETTINGS_XML)"
|
||||
if [ "$XML_SETTINGS_VER" = "2" ]; then
|
||||
xmlstarlet sel -t -m settings/setting -v @id -o "=\"" -v . -o "\"" -n "$SETTINGS_XML" > /var/config/ts_calibration_addon.conf
|
||||
else
|
||||
xmlstarlet sel -t -m settings -m setting -v @id -o "=\"" -v @value -o "\"" -n "$SETTINGS_XML" > /var/config/ts_calibration_addon.conf
|
||||
fi
|
||||
|
||||
. /var/config/ts_calibration_addon.conf
|
||||
|
||||
if [ "$TS_RECALIBRATE" = "true" ]; then
|
||||
sed -i 's|id="TS_RECALIBRATE"[ ]*value="true"|id="TS_RECALIBRATE" value="false"|g' "$SETTINGS_XML"
|
||||
touch $ADDON_HOME/recalibrate
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f $ADDON_HOME/recalibrate ]; then
|
||||
echo "recalibrating..."
|
||||
rm -f $ADDON_HOME/recalibrate
|
||||
ts_calibrate
|
||||
fi
|
||||
else
|
||||
echo "Stopping Kodi and touchscreen daemon..."
|
||||
systemctl stop kodi
|
||||
systemctl stop ts_uinput_touch
|
||||
|
||||
while pidof kodi.bin &>/dev/null; do
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
killall ts_uinput_touch &>/dev/null
|
||||
|
||||
ts_calibrate
|
||||
|
||||
# restart both if argument was set
|
||||
if [ "$1" = "run" ]; then
|
||||
echo "Starting touchscreen daemon and Kodi..."
|
||||
systemctl start ts_uinput_touch
|
||||
systemctl start kodi
|
||||
fi
|
||||
fi
|
@ -1,85 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
. /etc/profile
|
||||
|
||||
oe_setup_addon service.touchscreen
|
||||
|
||||
if [ -d /usr/share/kodi/addons/service.touchscreen ]; then
|
||||
# addon included in image
|
||||
ADDON_DIR=/usr/share/kodi/addons/service.touchscreen
|
||||
fi
|
||||
|
||||
if [ ! -f $ADDON_HOME/ts.conf-generic ]; then
|
||||
cp $ADDON_DIR/config/* $ADDON_HOME
|
||||
fi
|
||||
|
||||
if [ -f $ADDON_HOME/ts_env.sh ]; then
|
||||
# use user supplied script
|
||||
if [ ! -x $ADDON_HOME/ts_env.sh ]; then
|
||||
chmod +x $ADDON_HOME/ts_env.sh
|
||||
fi
|
||||
|
||||
dos2unix $ADDON_HOME/ts_env.sh
|
||||
dos2unix $ADDON_HOME/ts.conf
|
||||
|
||||
. $ADDON_HOME/ts_env.sh
|
||||
else
|
||||
# automatic start only on Udoo dual/quad for ldb screen
|
||||
LDB=""
|
||||
if grep -iq ":dev=ldb" /proc/cmdline; then
|
||||
LDB="yes"
|
||||
# maybe 7" LVDS display
|
||||
modprobe st1232 >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [ -n "$LDB" ]; then
|
||||
# find event# with command
|
||||
# ls -l /dev/input/by-id
|
||||
# or using evtest program
|
||||
|
||||
# st1232 module is always loaded so check for 3M first
|
||||
TS_DEVICE_1="3M 3M USB Touchscreen - EX II"
|
||||
TS_DEVICE_2="st1232-touchscreen"
|
||||
TS_DEVICE_CONF_1="ts.conf-udoo_15_6"
|
||||
TS_DEVICE_CONF_2="ts.conf-udoo_7"
|
||||
TS_DEVICE_CONF_GENERIC="ts.conf-generic"
|
||||
|
||||
#TS_DEVICE="$TS_DEVICE_1" # use specified one, should exist ts.conf for it
|
||||
TS_DEVICE="" # find one automatically
|
||||
#echo "device: $TS_DEVICE"
|
||||
|
||||
TS_DEVICE_CONF=""
|
||||
if [ -n "$TS_DEVICE" ]; then
|
||||
TSLIB_TSDEVICE=$(echo 999 | evtest 2>&1 >/dev/null | awk -F':' -v TS_DEVICE="$TS_DEVICE" '$0 ~ TS_DEVICE {print $1}')
|
||||
TS_DEVICE_CONF="$TS_DEVICE_CONF_GENERIC"
|
||||
else
|
||||
TSLIB_TSDEVICE=$(echo 999 | evtest 2>&1 >/dev/null | awk -F':' -v TS_DEVICE="$TS_DEVICE_1" '$0 ~ TS_DEVICE {print $1}')
|
||||
if [ -n "$TSLIB_TSDEVICE" ]; then
|
||||
TS_DEVICE_CONF="$TS_DEVICE_CONF_1"
|
||||
rmmod st1232 >/dev/null 2>&1 # it's not
|
||||
else
|
||||
TSLIB_TSDEVICE=$(echo 999 | evtest 2>&1 >/dev/null | awk -F':' -v TS_DEVICE="$TS_DEVICE_2" '$0 ~ TS_DEVICE {print $1}')
|
||||
if [ -n "$TSLIB_TSDEVICE" ]; then
|
||||
TS_DEVICE_CONF="$TS_DEVICE_CONF_2"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -f $ADDON_HOME/ts.conf -a -n "$TS_DEVICE_CONF" ]; then
|
||||
cp "$ADDON_HOME/$TS_DEVICE_CONF" $ADDON_HOME/ts.conf
|
||||
fi
|
||||
|
||||
export TSLIB_TSDEVICE="$TSLIB_TSDEVICE"
|
||||
export TSLIB_PLUGINDIR=$ADDON_DIR/lib
|
||||
export TSLIB_CONSOLEDEVICE=none
|
||||
export TSLIB_FBDEVICE=/dev/fb0
|
||||
export TSLIB_CALIBFILE=$ADDON_HOME/pointercal
|
||||
export TSLIB_CONFFILE=$ADDON_HOME/ts.conf
|
||||
|
||||
#export TSLIB_RES_X=800
|
||||
#export TSLIB_RES_Y=480
|
||||
fi
|
||||
fi
|
@ -1,41 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
. /etc/profile
|
||||
|
||||
oe_setup_addon service.touchscreen
|
||||
|
||||
if [ -d /usr/share/kodi/addons/service.touchscreen ]; then
|
||||
# addon included in image
|
||||
ADDON_DIR="/usr/share/kodi/addons/service.touchscreen"
|
||||
fi
|
||||
|
||||
. $ADDON_DIR/bin/ts_env.sh
|
||||
|
||||
params=$*
|
||||
|
||||
if [ "$1" = "service" ]; then
|
||||
# skip service parameter and daemonize
|
||||
params="-d"
|
||||
else
|
||||
# started from command line
|
||||
systemctl stop ts_uinput_touch >/dev/null 2>&1
|
||||
killall ts_uinput_touch >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
echo " touchscreen device: '$TSLIB_TSDEVICE'"
|
||||
|
||||
if [ -n "$TSLIB_RES_X" -a -n "$TSLIB_RES_Y" ]; then
|
||||
echo "touchscreen resolution: '${TSLIB_RES_X}x${TSLIB_RES_Y}'"
|
||||
params="-x $TSLIB_RES_X -y $TSLIB_RES_Y $params"
|
||||
fi
|
||||
|
||||
echo "params: .$params."
|
||||
if [ ! -x $ADDON_HOME/ts_uinput_touch ]; then
|
||||
ts_uinput_touch $params
|
||||
else
|
||||
echo "Using $ADDON_HOME/ts_uinput_touch"
|
||||
$ADDON_HOME/ts_uinput_touch $params
|
||||
fi
|
@ -1,142 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
import os
|
||||
import socket
|
||||
import sys
|
||||
from threading import Thread
|
||||
import xbmc
|
||||
import xbmcgui
|
||||
import xbmcaddon
|
||||
|
||||
TEXT_ALIGN_LEFT = 0
|
||||
TEXT_ALIGN_RIGHT = 1
|
||||
TEXT_ALIGN_CENTER_X = 2
|
||||
TEXT_ALIGN_CENTER_Y = 4
|
||||
TEXT_ALIGN_RIGHT_CENTER_Y = 5
|
||||
TEXT_ALIGN_LEFT_CENTER_X_CENTER_Y = 6
|
||||
ACTION_PREVIOUS_MENU = 10
|
||||
ACTION_BACKSPACE = 92
|
||||
|
||||
SOCK_PATH = "/tmp/ts_calibrate.socket"
|
||||
TSLIB_EDGE_OFFEST = 50
|
||||
CROSSHAIR_IMAGE_SIZE = 23
|
||||
CROSSHAIR_IMAGE_OFFSET = 11
|
||||
SKIN_WIDTH = 1280 # we are using 720p skin
|
||||
SKIN_HEIGHT = 720
|
||||
|
||||
class coordinates:
|
||||
var_x = 0
|
||||
var_y = 0
|
||||
|
||||
def server_thread(conn, self):
|
||||
while True:
|
||||
data = conn.recv(128)
|
||||
if not data:
|
||||
break
|
||||
|
||||
self.currentTarget = self.currentTarget + 1
|
||||
if self.currentTarget > 0:
|
||||
self.removeControl(self.targetImage)
|
||||
|
||||
if self.currentTarget == 5:
|
||||
xbmcgui.Dialog().ok("Calibration", "Calibration done.")
|
||||
break
|
||||
|
||||
self.info.setLabel("Touch '" + data + "' crosshair")
|
||||
self.targetImage = xbmcgui.ControlImage(
|
||||
self.touch_points[self.currentTarget].var_x - CROSSHAIR_IMAGE_OFFSET,
|
||||
self.touch_points[self.currentTarget].var_y - CROSSHAIR_IMAGE_OFFSET,
|
||||
CROSSHAIR_IMAGE_SIZE, CROSSHAIR_IMAGE_SIZE,
|
||||
self.crosshair_path, colorDiffuse='0x00000000')
|
||||
self.addControl(self.targetImage)
|
||||
|
||||
# out of loop, close connection
|
||||
conn.close()
|
||||
os.remove(SOCK_PATH)
|
||||
self.retval = 0
|
||||
self.close()
|
||||
|
||||
class ts_calibrate(xbmcgui.WindowDialog):
|
||||
def __init__(self):
|
||||
self.retval = 0
|
||||
self.media_path=os.path.join(addon.getAddonInfo('path'), 'resources','media') + '/'
|
||||
self.crosshair_path = self.media_path + 'crosshair.png'
|
||||
self.currentTarget = -1
|
||||
|
||||
self.edge_offset_x = TSLIB_EDGE_OFFEST * SKIN_WIDTH / self.getWidth()
|
||||
self.edge_offset_y = TSLIB_EDGE_OFFEST * SKIN_HEIGHT / self.getHeight()
|
||||
|
||||
self.touch_points = [coordinates() for i in range(5)]
|
||||
self.touch_points[0].var_x = self.edge_offset_x
|
||||
self.touch_points[0].var_y = self.edge_offset_y
|
||||
self.touch_points[1].var_x = SKIN_WIDTH - self.edge_offset_x
|
||||
self.touch_points[1].var_y = self.edge_offset_y
|
||||
self.touch_points[2].var_x = SKIN_WIDTH - self.edge_offset_x
|
||||
self.touch_points[2].var_y = SKIN_HEIGHT - self.edge_offset_y
|
||||
self.touch_points[3].var_x = self.edge_offset_x
|
||||
self.touch_points[3].var_y = SKIN_HEIGHT - self.edge_offset_y
|
||||
self.touch_points[4].var_x = SKIN_WIDTH / 2
|
||||
self.touch_points[4].var_y = SKIN_HEIGHT / 2
|
||||
|
||||
self.background = xbmcgui.ControlImage(0, 0, SKIN_WIDTH, SKIN_HEIGHT,
|
||||
self.media_path + 'background.jpg', colorDiffuse = '0xffffffff')
|
||||
self.addControl(self.background)
|
||||
|
||||
tmp_str = "Tslib/Kodi calibration utility\n\nTouch crosshair to calibrate"
|
||||
tmp_str += "\n\nresolution: " + str(self.getWidth()) + "x" + str(self.getHeight())
|
||||
tmp_str += "\nskin: " + str(SKIN_WIDTH) + "x" + str(SKIN_HEIGHT)
|
||||
|
||||
self.about = xbmcgui.ControlLabel(
|
||||
10, 80, SKIN_WIDTH, 400,
|
||||
"", textColor = '0xffffffff', font = 'font25', alignment = TEXT_ALIGN_CENTER_X)
|
||||
self.addControl(self.about)
|
||||
self.about.setLabel(tmp_str)
|
||||
|
||||
self.info = xbmcgui.ControlLabel(
|
||||
20, SKIN_HEIGHT/2 - 40,
|
||||
1000, 400,
|
||||
"", textColor = '0xffffffff', font = 'font30', alignment = TEXT_ALIGN_LEFT)
|
||||
self.addControl(self.info)
|
||||
self.info.setLabel("")
|
||||
|
||||
if os.path.exists(SOCK_PATH):
|
||||
os.remove(SOCK_PATH)
|
||||
|
||||
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
sock.bind(SOCK_PATH)
|
||||
sock.listen(1)
|
||||
|
||||
# enter calibration mode
|
||||
os.system("killall -SIGUSR1 ts_uinput_touch")
|
||||
|
||||
print 'Waiting for calibration connection'
|
||||
conn, addr = sock.accept()
|
||||
print 'Calibration connection accepted'
|
||||
|
||||
self.t = Thread(target=server_thread, args=(conn, self,))
|
||||
self.t.start()
|
||||
|
||||
def onAction(self, action):
|
||||
if action == ACTION_PREVIOUS_MENU or action == ACTION_BACKSPACE:
|
||||
self.retval = 0
|
||||
self.close()
|
||||
|
||||
addon = xbmcaddon.Addon(id = 'service.touchscreen')
|
||||
finished = False
|
||||
|
||||
while finished == False:
|
||||
dialog = ts_calibrate()
|
||||
dialog.doModal()
|
||||
|
||||
if dialog.retval == 0:
|
||||
finished = True
|
||||
del dialog
|
||||
|
||||
del addon
|
||||
# exit calibration mode
|
||||
os.system("killall -SIGUSR2 ts_uinput_touch")
|
||||
|
||||
if os.path.exists(SOCK_PATH):
|
||||
os.remove(SOCK_PATH)
|
||||
|
@ -1,8 +0,0 @@
|
||||
module_raw input grab_events=1
|
||||
module pthres pmin=1
|
||||
module variance delta=30
|
||||
module dejitter delta=100
|
||||
|
||||
module linear
|
||||
# or use swap_xy parameter to swap axes
|
||||
#module linear swap_xy=1
|
@ -1,6 +0,0 @@
|
||||
# Udoo with 15.6" 1366x768 display with 3M USB Touchscreen - EX II
|
||||
module_raw input grab_events=1
|
||||
module pthres pmin=1
|
||||
module variance delta=30
|
||||
module dejitter delta=100
|
||||
module linear
|
@ -1,3 +0,0 @@
|
||||
# Udoo with 7" 800x480 display with ST1232 touch controler
|
||||
# only st1232 raw input module is used
|
||||
module_raw st1232 grab_events=1 invert_y=480
|
@ -1,6 +0,0 @@
|
||||
# len is hidraw data size
|
||||
module_raw waveshare len=22
|
||||
module pthres pmin=1
|
||||
module variance delta=30
|
||||
module dejitter delta=100
|
||||
module linear
|
@ -1,28 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
# find touchscreen device by name (substring) using evtest program
|
||||
|
||||
# $ evtest
|
||||
# No device specified, trying to scan all of /dev/input/event*
|
||||
# Available devices:
|
||||
# /dev/input/event0: Video Bus
|
||||
# /dev/input/event1: Goodix Capacitive TouchScreen
|
||||
# Select the device event number [0-1]:
|
||||
|
||||
TOUCHSCREEN_NAME="Goodix Capacitive TouchScreen"
|
||||
|
||||
TSLIB_TSDEVICE=$(echo 999 | evtest 2>&1 >/dev/null | awk -F':' -v TS_NAME="$TOUCHSCREEN_NAME" '$0 ~ TS_NAME {print $1; exit}')
|
||||
export TSLIB_TSDEVICE
|
||||
|
||||
export TSLIB_PLUGINDIR=$ADDON_DIR/lib
|
||||
export TSLIB_CONSOLEDEVICE=none
|
||||
export TSLIB_FBDEVICE=/dev/fb0
|
||||
export TSLIB_CALIBFILE=/storage/.kodi/userdata/addon_data/service.touchscreen/pointercal
|
||||
export TSLIB_CONFFILE=/storage/.kodi/userdata/addon_data/service.touchscreen/ts.conf
|
||||
|
||||
# sometimes needed
|
||||
#export TSLIB_RES_X=800
|
||||
#export TSLIB_RES_Y=480
|
@ -1,48 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
# change vid/pid for waveshare touchscreen device
|
||||
PRODUCT_VID=0EEF
|
||||
PRODUCT_PID=0005
|
||||
|
||||
# device set directly or find automaticaly at the end of this script
|
||||
export TSLIB_TSDEVICE=""
|
||||
#export TSLIB_TSDEVICE="/dev/hidrawN"
|
||||
|
||||
export TSLIB_PLUGINDIR=$ADDON_DIR/lib
|
||||
export TSLIB_CONSOLEDEVICE=none
|
||||
export TSLIB_FBDEVICE=/dev/fb0
|
||||
export TSLIB_CALIBFILE=/storage/.kodi/userdata/addon_data/service.touchscreen/pointercal
|
||||
export TSLIB_CONFFILE=/storage/.kodi/userdata/addon_data/service.touchscreen/ts.conf
|
||||
|
||||
export TSLIB_RES_X=800
|
||||
export TSLIB_RES_Y=480
|
||||
|
||||
|
||||
# find touchscreen device
|
||||
if [ "$TSLIB_TSDEVICE" = "" ]; then
|
||||
PRODUCT_VID_PID="0000${PRODUCT_VID}:0000${PRODUCT_PID}"
|
||||
echo "PRODUCT_VID_PID: $PRODUCT_VID_PID"
|
||||
|
||||
hidrawN=""
|
||||
for dev in /sys/class/hidraw/hidraw*/device/uevent; do
|
||||
echo
|
||||
echo "device: $dev"
|
||||
|
||||
HID_ID=$(cat $dev | grep HID_ID | grep "$PRODUCT_VID_PID")
|
||||
if [ -n "$HID_ID" ]; then
|
||||
hidrawN=$(echo $dev | awk -F "/" '{print $5}')
|
||||
hidrawN="/dev/$hidrawN"
|
||||
echo "OK HID_ID: $HID_ID"
|
||||
echo "OK hidrawN: $hidrawN"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$hidrawN" ]; then
|
||||
echo "found hidrawN: $hidrawN"
|
||||
export TSLIB_TSDEVICE=$hidrawN
|
||||
fi
|
||||
fi
|
@ -1,33 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
import xbmc
|
||||
import xbmcgui
|
||||
import xbmcaddon
|
||||
|
||||
__scriptid__ = 'service.touchscreen'
|
||||
__addon__ = xbmcaddon.Addon(id=__scriptid__)
|
||||
_ = __addon__.getLocalizedString
|
||||
|
||||
# http://forum.kodi.tv/showthread.php?tid=230766
|
||||
def handle_wait(time_to_wait, title, text):
|
||||
dialog = xbmcgui.DialogProgress()
|
||||
ret = dialog.create(' ' + title)
|
||||
secs = 0
|
||||
percent = 0
|
||||
increment = int(100 / time_to_wait)
|
||||
|
||||
while secs < time_to_wait:
|
||||
secs += 1
|
||||
percent = increment*secs
|
||||
secs_left = time_to_wait - secs
|
||||
remaining_display = (_(2030).encode('utf-8')) % secs_left
|
||||
dialog.update(percent, text, "", remaining_display)
|
||||
xbmc.sleep(1000)
|
||||
|
||||
dialog.close()
|
||||
return False
|
||||
|
||||
# how long to lock the screen
|
||||
lock_secs = 30
|
||||
handle_wait(lock_secs, _(2010).encode('utf-8'), _(2020).encode('utf-8'))
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<strings>
|
||||
<string id="1000">General</string>
|
||||
<string id="1010">Recalibrate after reboot</string>
|
||||
<string id="1020">Clean screen</string>
|
||||
|
||||
<string id="2010">Touchscreen</string>
|
||||
<string id="2020">Now you can safely clean the screen.</string>
|
||||
<string id="2030">Still %d seconds left.</string>
|
||||
</strings>
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<strings>
|
||||
<string id="1000">Allgemein</string>
|
||||
<string id="1010">Nach einem Neustart neu kalibrieren</string>
|
||||
<string id="1020">Touchscreen reinigen</string>
|
||||
|
||||
<string id="2010">Touchscreen</string>
|
||||
<string id="2020">Sie können jetzt den Touchscreen sicher reinigen.</string>
|
||||
<string id="2030">Noch %d Sekunden übrig.</string>
|
||||
</strings>
|
Before Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 168 B |
Before Width: | Height: | Size: 142 KiB |
Before Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 69 KiB |
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<settings>
|
||||
<category label="1000" >
|
||||
<setting type="sep" />
|
||||
<setting label="1010" id="TS_RECALIBRATE" type="bool" default="false" />
|
||||
<setting label="1020" id="clean_screen" type="action" option="close" action="RunScript($CWD/lock-screen.py)" />
|
||||
</category>
|
||||
</settings>
|
@ -1,2 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
|
@ -1,14 +0,0 @@
|
||||
[Unit]
|
||||
Description=Touchscreen support daemon
|
||||
After=graphical.target
|
||||
Before=kodi.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
Environment=HOME=/storage
|
||||
ExecStartPre=-/bin/sh -c "exec /bin/sh /storage/.kodi/addons/service.touchscreen/bin/ts_calibrate.sh service"
|
||||
ExecStart=-/bin/sh -c "exec /bin/sh /storage/.kodi/addons/service.touchscreen/bin/ts_uinput_touch.sh service"
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=kodi.target
|