Script to detect a Touchscreen?
Posted: Fri 27 Mar 2015, 11:55
Is there a way to detect that a touchscreen is present from a script test?
READ-ONLY Archive
https://oldforum.puppylinux.com/
Code: Select all
sed '/Sysfs=/!d; s/.*=//' /proc/bus/input/devices | xargs -I '{}' udevadm info --path='{}' | grep TOUCHSCREEN
Code: Select all
grep TOUCHSCREEN /run/udev/data/*
Code: Select all
xinput list | grep -i touchscreen
Code: Select all
dmesg | grep usb
Code: Select all
if [ $touchscreen_present ]; then
edit xorg.conf
fi
Code: Select all
# dmesg | grep usb
[ 0.000000] Kernel command line: video=640x480 psubdir=b3skype_beta pmedia=usbflash pfix=fsck
[ 0.120186] usbcore: registered new interface driver usbfs
[ 0.120186] usbcore: registered new interface driver hub
[ 0.120186] usbcore: registered new device driver usb
[ 0.716716] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 0.716719] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.716722] usb usb1: Product: EHCI Host Controller
[ 0.716724] usb usb1: Manufacturer: Linux 3.4.52 ehci_hcd
[ 0.716726] usb usb1: SerialNumber: 0000:00:1a.7
[ 0.730035] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[ 0.730039] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.730041] usb usb2: Product: EHCI Host Controller
[ 0.730043] usb usb2: Manufacturer: Linux 3.4.52 ehci_hcd
[ 0.730045] usb usb2: SerialNumber: 0000:00:1d.7
[ 0.730394] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001
[ 0.730397] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.730399] usb usb3: Product: UHCI Host Controller
[ 0.730402] usb usb3: Manufacturer: Linux 3.4.52 uhci_hcd
[ 0.730404] usb usb3: SerialNumber: 0000:00:1a.0
[ 0.730672] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001
[ 0.730675] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.730677] usb usb4: Product: UHCI Host Controller
[ 0.730679] usb usb4: Manufacturer: Linux 3.4.52 uhci_hcd
[ 0.730681] usb usb4: SerialNumber: 0000:00:1a.1
[ 0.730943] usb usb5: New USB device found, idVendor=1d6b, idProduct=0001
[ 0.730945] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.730948] usb usb5: Product: UHCI Host Controller
[ 0.730950] usb usb5: Manufacturer: Linux 3.4.52 uhci_hcd
[ 0.730952] usb usb5: SerialNumber: 0000:00:1d.0
[ 0.731217] usb usb6: New USB device found, idVendor=1d6b, idProduct=0001
[ 0.731220] usb usb6: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.731222] usb usb6: Product: UHCI Host Controller
[ 0.731224] usb usb6: Manufacturer: Linux 3.4.52 uhci_hcd
[ 0.731227] usb usb6: SerialNumber: 0000:00:1d.1
[ 0.731480] usb usb7: New USB device found, idVendor=1d6b, idProduct=0001
[ 0.731483] usb usb7: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.731485] usb usb7: Product: UHCI Host Controller
[ 0.731487] usb usb7: Manufacturer: Linux 3.4.52 uhci_hcd
[ 0.731490] usb usb7: SerialNumber: 0000:00:1d.2
[ 0.731802] usbcore: registered new interface driver usb-storage
[ 0.731845] usbcore: registered new interface driver libusual
[ 0.731856] usbcore: registered new interface driver ums-alauda
[ 0.731868] usbcore: registered new interface driver ums-datafab
[ 0.731879] usbcore: registered new interface driver ums_eneub6250
[ 0.731890] usbcore: registered new interface driver ums-freecom
[ 0.731901] usbcore: registered new interface driver ums-isd200
[ 0.731913] usbcore: registered new interface driver ums-jumpshot
[ 0.731928] usbcore: registered new interface driver ums-realtek
[ 0.731939] usbcore: registered new interface driver ums-sddr09
[ 0.731951] usbcore: registered new interface driver ums-sddr55
[ 0.731962] usbcore: registered new interface driver ums-usbat
[ 0.731980] usbcore: registered new interface driver ldusb
[ 0.737779] usbcore: registered new interface driver usbhid
[ 0.737780] usbhid: USB HID core driver
[ 1.023354] usb 1-4: new high-speed USB device number 2 using ehci_hcd
[ 1.160410] usb 1-4: New USB device found, idVendor=04f2, idProduct=b008
[ 1.160413] usb 1-4: New USB device strings: Mfr=2, Product=1, SerialNumber=3
[ 1.160416] usb 1-4: Product: Chicony USB 2.0 Camera
[ 1.160418] usb 1-4: Manufacturer: Chicony Electronics Co., Ltd.
[ 1.160420] usb 1-4: SerialNumber: SN0001
[ 1.373345] usb 2-5: new high-speed USB device number 3 using ehci_hcd
[ 1.498414] usb 2-5: New USB device found, idVendor=8564, idProduct=1000
[ 1.498417] usb 2-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1.498420] usb 2-5: Product: Mass Storage Device
[ 1.498422] usb 2-5: Manufacturer: JetFlash
[ 1.498424] usb 2-5: SerialNumber: 23BHNQDCK7CJC7RW
[ 1.498733] scsi5 : usb-storage 2-5:1.0
[ 1.723344] usb 6-1: new full-speed USB device number 2 using uhci_hcd
[ 1.881219] usb 6-1: New USB device found, idVendor=08ff, idProduct=1600
[ 1.881222] usb 6-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 1.881225] usb 6-1: Product: Fingerprint Sensor
[ 35.573378] usb 6-2: new full-speed USB device number 3 using uhci_hcd
[ 35.748272] usb 6-2: New USB device found, idVendor=0930, idProduct=0508
[ 35.748276] usb 6-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 35.953722] usbcore: registered new interface driver btusb
[ 36.078782] input: Chicony USB 2.0 Camera as /devices/pci0000:00/0000:00:1a.7/usb1/1-4/1-4:1.0/input/input8
[ 36.078849] usbcore: registered new interface driver uvcvideo
#
Okay, I see clearly nowpeebee wrote:gcmartin has requested ...
All the 3 codes I suggested above is meant exactly for that, e.g.So far I can't really see how to make a touchscreen_present test....Code: Select all
if [ $touchscreen_present ]; then edit xorg.conf fi
Code: Select all
if grep -q TOUCHSCREEN /run/udev/data/*; then
edit xorg
fi
Here is the result of "cat /sys/class/hidraw/hidraw*/device/uevent" on a touchscreen laptop. I would have thought that gcmartin already volunteered this information himself ...Googling, I've seen a suggestion that the contents of:
/sys/class/hidraw/hidraw*/device/uevent
might provide an indication - can anybody with a touchscreen look into their files (for some reason you must use leafpad to see the contents - they don't display in geany) and post the result for the touchscreen.
Code: Select all
DRIVER=hid-generic
HID_ID=0003:000003EB:0000880F
HID_NAME=Atmel Atmel maXTouch Digitizer
HID_PHYS=usb-0000:00:14.0-3/input1
HID_UNIQ=
MODALIAS=hid:b0003g0001v000003EBp0000880F
DRIVER=hid-generic
HID_ID=0003:0000046D:0000C52F
HID_NAME=Logitech USB Receiver
HID_PHYS=usb-0000:00:14.0-7/input0
HID_UNIQ=
MODALIAS=hid:b0003g0001v0000046Dp0000C52F
DRIVER=hid-generic
HID_ID=0003:0000046D:0000C52F
HID_NAME=Logitech USB Receiver
HID_PHYS=usb-0000:00:14.0-7/input1
HID_UNIQ=
MODALIAS=hid:b0003g0001v0000046Dp0000C52F
DRIVER=hid-multitouch
HID_ID=0003:000003EB:0000880F
HID_NAME=Atmel Atmel maXTouch Digitizer
HID_PHYS=usb-0000:00:14.0-3/input0
HID_UNIQ=
MODALIAS=hid:b0003g0004v000003EBp0000880F
Code: Select all
# sed '/Sysfs=/!d; s/.*=//' /proc/bus/input/devices | xargs -I '{}' udevadm info --path='{}' | grep TOUCHSCREEN
missing option
missing option
missing option
missing option
missing option
missing option
missing option
missing option
missing option
missing option
missing option
missing option
missing option
# grep TOUCHSCREEN /run/udev/data/*
#
# xinput list | grep -i touchscreen
bash: xinput: command not found
Any volunteers?01micko wrote:This really needs to be done,
'Twas a tale in requisite of a testicular tweak.peebee wrote:I feel like I maybe tweaked a tiger's tail