martin-ueding / thinkpad-scripts

Screen rotation, docking and other scripts for ThinkPad® X220 and X230 Tablet
Other
132 stars 23 forks source link

Fixed touchscreen designation for thinkpad-touch on Fedora #120

Closed Aruee closed 8 years ago

Aruee commented 8 years ago

On Fedora 23, the xinput name for the touchscreen device is Wacom ISDv4 E6 Finger, not Wacom ISDv4 E6 Finger touch, breaking the thinkpad-touch script. This commit fixes this by altering the default.ini file accordingly.

For the sake of completeness: Here's what I got prior to this fix:

$ thinkpad-touch
Traceback (most recent call last):
  File "/usr/bin/thinkpad-touch", line 9, in <module>
    load_entry_point('thinkpad-scripts==4.7.3', 'console_scripts', 'thinkpad-touch')()
  File "/usr/lib/python3.4/site-packages/thinkpad_scripts-4.7.3-py3.4.egg/tps/main_touchscreen.py", line 16, in main
  File "/usr/lib/python3.4/site-packages/thinkpad_scripts-4.7.3-py3.4.egg/tps/input.py", line 183, in state_change_ui
  File "/usr/lib/python3.4/site-packages/thinkpad_scripts-4.7.3-py3.4.egg/tps/input.py", line 131, in get_xinput_id
tps.input.InputDeviceNotFoundException: Input device “Wacom ISDv4 E6 Finger touch” could not be found
martin-ueding commented 8 years ago

On my machine, also running Fedora 23, I have this config.ini in my local directory:

[input]
touchscreen_device = Wacom ISDv4 E6 Finger

So this definitely fixes the issue. I have not altered that upstream since I thought that most people use Ubuntu. However, this is a regular expression and one can adapt it for all users.

The current implementation does allow not for any word behind the string given in the configuration:

re.search(name + r'\s*id=(\d+)', output)

Therefore this change would break it for people where the device is called differently. So the way to do it would be:

touchscreen_device = Wacom ISDv4 E6 Finger.*?

That .*? then eats up all the following characters without eating too much. I have just tested it with Fing.*? at the end, it works on my machine. I would assume that the change would work on other machines as well.

martin-ueding commented 8 years ago

This should now be fixed in version 4.7.4. That version has not been built for Ubuntu, it is currently building for Fedora 22, 23 and 24. See the status monitor.

I am not sure how you install thinkpad-scripts. If you use my OBS repo, you should get an update sooner or later.

Aruee commented 8 years ago

That was quick ^^

I am not sure how you install thinkpad-scripts.

from source, so I'll just pull and install again. Thanks for the support :)