martin-ueding/thinkpad-scripts

X200 Wacom Does Not Rotate With Screen

samanthacm opened this issue · 23 comments

Comparing my logs after running thinkpad-rotate -vv, it seems like xsetwacom --list is not running to try and find the devices.

$ xsetwacom --list
Wacom Serial Penabled 1FG Touchscreen stylus    id: 13  type: STYLUS
Wacom Serial Penabled 1FG Touchscreen eraser    id: 14  type: ERASER
Wacom Serial Penabled 1FG Touchscreen touch id: 15  type: TOUCH'''

My Config File

$ cat ~/.config/thinkpad-scripts/config.ini
[input]
touchscreen_device = Wacom Serial Penabled 1FG Touchscreen touch

[touch]
regex = Wacom Serial Penabled 1FG Touchscreen.*id: (\d+).*
$ thinkpad-rotate -vv flip
tps.config    DEBUG    ----------------------------------
tps.config    DEBUG    Program was started with arguments: ['/usr/bin/thinkpad-rotate', '-vv', 'flip']
tps.config    DEBUG    Default configfile is /usr/lib/python3.4/site-packages/tps/default.ini.
tps.screen    DEBUG    subprocess “xrandr -q --verbose”
tps           DEBUG    Converted “normal” to “Direction(xrandr='normal', subpixel='rgb', physically_closed=False, rot_mat=[1, 0, 0, 0, 1, 0, 0, 0, 1])”.
tps.screen    INFO     Current rotation is “Direction(xrandr='normal', subpixel='rgb', physically_closed=False, rot_mat=[1, 0, 0, 0, 1, 0, 0, 0, 1])”.
tps           DEBUG    Converted “flip” to “Direction(xrandr='inverted', subpixel='bgr', physically_closed=True, rot_mat=[-1, 0, 1, 0, -1, 1, 0, 0, 1])”.
tps.rotate    INFO     User chose to set to Direction(xrandr='inverted', subpixel='bgr', physically_closed=True, rot_mat=[-1, 0, 1, 0, -1, 1, 0, 0, 1])
tps           DEBUG    Command “/home/samantha/.config/thinkpad-scripts/hooks/prerotate” not found.
tps.screen    DEBUG    subprocess “xrandr --output LVDS1 --rotate inverted”
tps.screen    DEBUG    subprocess “xrandr -q”
tps.input     DEBUG    Translation and scaling matrix: [[  1.00000   0.00000   0.00000 ][  0.00000   1.00000   0.00000 ][  0.00000   0.00000   1.00000 ]]
tps.input     DEBUG    Complete transformation matrix: [[ -1.00000   0.00000   1.00000 ][  0.00000  -1.00000   1.00000 ][  0.00000   0.00000   1.00000 ]]
tps.config    DEBUG    Default configfile is /usr/lib/python3.4/site-packages/tps/default.ini.
tps.input     DEBUG    Using “Wacom Serial Penabled 1FG Touchscreen.*id: (\d+).*” as regex to find Wacom devices.
tps.input     DEBUG    subprocess “xinput”
tps.screen    DEBUG    subprocess “xrandr”
tps           DEBUG    Command “xfconf-query” found.
tps.screen    DEBUG    subprocess “xfconf-query -c xsettings -p /Xft/RGBA -s bgr”
Property "/Xft/RGBA" does not exist on channel "xsettings". If a new property should be created, use the --create option.
tps.screen    ERROR    Command '['xfconf-query', '-c', 'xsettings', '-p', '/Xft/RGBA', '-s', 'bgr']' returned non-zero exit status 1
tps.vkeyboard DEBUG    subprocess “pgrep kvkbd”
tps           DEBUG    Command “kvkbd” found.
tps.vkeyboard DEBUG    kvkbd
tps.input     DEBUG    subprocess “xinput list”
tps.input     DEBUG    subprocess “xinput set-prop 11 Device Enabled 0”
tps.input     DEBUG    subprocess “xinput list”
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
tps.rotate    INFO     TouchPad was not found, could not be (de)activated.
tps.rotate    DEBUG    Exception was: “Input device “TouchPad” could not be found”
tps           DEBUG    Command “/home/samantha/.config/thinkpad-scripts/hooks/postrotate” not found.
[samantha@athena ~]$ No systemtrayicon available
thinkpad-rotate -vv flip
tps.config    DEBUG    ----------------------------------
tps.config    DEBUG    Program was started with arguments: ['/usr/bin/thinkpad-rotate', '-vv', 'flip']
tps.config    DEBUG    Default configfile is /usr/lib/python3.4/site-packages/tps/default.ini.
tps.screen    DEBUG    subprocess “xrandr -q --verbose”
tps           DEBUG    Converted “inverted” to “Direction(xrandr='inverted', subpixel='bgr', physically_closed=True, rot_mat=[-1, 0, 1, 0, -1, 1, 0, 0, 1])”.
tps.screen    INFO     Current rotation is “Direction(xrandr='inverted', subpixel='bgr', physically_closed=True, rot_mat=[-1, 0, 1, 0, -1, 1, 0, 0, 1])”.
tps           DEBUG    Converted “flip” to “Direction(xrandr='inverted', subpixel='bgr', physically_closed=True, rot_mat=[-1, 0, 1, 0, -1, 1, 0, 0, 1])”.
tps.rotate    INFO     You try to rotate into the direction it is, reverting to normal.
tps           DEBUG    Command “/home/samantha/.config/thinkpad-scripts/hooks/prerotate” not found.
tps.screen    DEBUG    subprocess “xrandr --output LVDS1 --rotate normal”
tps.screen    DEBUG    subprocess “xrandr -q”
tps.input     DEBUG    Translation and scaling matrix: [[  1.00000   0.00000   0.00000 ][  0.00000   1.00000   0.00000 ][  0.00000   0.00000   1.00000 ]]
tps.input     DEBUG    Complete transformation matrix: [[  1.00000   0.00000   0.00000 ][  0.00000   1.00000   0.00000 ][  0.00000   0.00000   1.00000 ]]
tps.config    DEBUG    Default configfile is /usr/lib/python3.4/site-packages/tps/default.ini.
tps.input     DEBUG    Using “Wacom Serial Penabled 1FG Touchscreen.*id: (\d+).*” as regex to find Wacom devices.
tps.input     DEBUG    subprocess “xinput”
tps.screen    DEBUG    subprocess “xrandr”
tps           DEBUG    Command “xfconf-query” found.
tps.screen    DEBUG    subprocess “xfconf-query -c xsettings -p /Xft/RGBA -s rgb”
Property "/Xft/RGBA" does not exist on channel "xsettings". If a new property should be created, use the --create option.
tps.screen    ERROR    Command '['xfconf-query', '-c', 'xsettings', '-p', '/Xft/RGBA', '-s', 'rgb']' returned non-zero exit status 1
tps.vkeyboard DEBUG    subprocess “pgrep kvkbd”
tps.vkeyboard DEBUG    subprocess “killall kvkbd”
tps.input     DEBUG    subprocess “xinput list”
tps.input     DEBUG    subprocess “xinput set-prop 11 Device Enabled 1”
tps.input     DEBUG    subprocess “xinput list”
tps.rotate    INFO     TouchPad was not found, could not be (de)activated.
tps.rotate    DEBUG    Exception was: “Input device “TouchPad” could not be found”
tps           DEBUG    Command “/home/samantha/.config/thinkpad-scripts/hooks/postrotate” not found.
$ xrandr

Screen 0: minimum 8 x 8, current 1280 x 800, maximum 32767 x 32767

LVDS1 connected primary 1280x800+0+0 (normal left inverted right x axis y axis) 261mm x 163mm panning 1280x800+0+0

   1280x800      60.00*+

   1024x768      60.00

   800x600       60.32    56.25

   640x480       59.94

   640x400       60.00

DP1 disconnected (normal left inverted right x axis y axis)

DP2 disconnected (normal left inverted right x axis y axis)

DP3 disconnected (normal left inverted right x axis y axis)

HDMI1 disconnected (normal left inverted right x axis y axis)

HDMI2 disconnected (normal left inverted right x axis y axis)

VGA1 disconnected (normal left inverted right x axis y axis)

VIRTUAL1 disconnected (normal left inverted right x axis y axis)

We removed xsetwacom since we can set everything with xinput as well. The MapToOutput feature of xsetwacom was replaced by transformation matrices that I compute on the fly. The script does call xinput list. You can check whether the regular expression that you have matches anything in there. What does xinput list give you?

$ xinput list
⎡ Virtual core pointer                        id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                     id=11   [slave  pointer  (2)]
⎜   ↳ Wacom Serial Penabled 1FG Touchscreen stylus  id=13   [slave  pointer  (2)]
⎜   ↳ Wacom Serial Penabled 1FG Touchscreen eraser  id=14   [slave  pointer  (2)]
⎜   ↳ Wacom Serial Penabled 1FG Touchscreen touch   id=15   [slave  pointer  (2)]
⎣ Virtual core keyboard                       id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard                 id=5    [slave  keyboard (3)]
    ↳ Power Button                                id=6    [slave  keyboard (3)]
    ↳ Video Bus                                   id=7    [slave  keyboard (3)]
    ↳ Sleep Button                                id=8    [slave  keyboard (3)]
    ↳ UVC Camera (17ef:480c)                      id=9    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard                id=10   [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                      id=12   [slave  keyboard (3)]

Here is the output of xinput list-props for 13, 14 and 15.

$ xinput list-props 13
Device 'Wacom Serial Penabled 1FG Touchscreen stylus':
    Device Enabled (136):   1
    Coordinate Transformation Matrix (138): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    Device Accel Profile (265): 0
    Device Accel Constant Deceleration (266):   1.000000
    Device Accel Adaptive Deceleration (267):   1.000000
    Device Accel Velocity Scaling (268):    10.000000
    Device Node (257):  "/dev/input/event13"
    Wacom Tablet Area (289):    0, 0, 26312, 16520
    Wacom Rotation (290):   0
    Wacom Pressurecurve (291):  0, 0, 100, 100
    Wacom Serial IDs (292): 147, 0, 2, 0, 0
    Wacom Serial ID binding (293):  0
    Wacom Pressure Threshold (294): 27
    Wacom Sample and Suppress (295):    2, 4
    Wacom Enable Touch (296):   1
    Wacom Hover Click (297):    0
    Wacom Enable Touch Gesture (298):   0
    Wacom Touch Gesture Parameters (299):   0, 0, 250
    Wacom Tool Type (300):  "STYLUS" (282)
    Wacom Button Actions (301): "Wacom button action 0" (302), "Wacom button action 1" (303), "Wacom button action 2" (304)
    Wacom button action 0 (302):    1572865
    Wacom button action 1 (303):    1572867
    Wacom button action 2 (304):    1572866
    Wacom Pressure Recalibration (305): 1
    Device Product ID (258):    1386, 147
    Wacom Debug Levels (306):   0, 0
$ xinput list-props 14
Device 'Wacom Serial Penabled 1FG Touchscreen eraser':
    Device Enabled (136):   1
    Coordinate Transformation Matrix (138): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    Device Accel Profile (265): 0
    Device Accel Constant Deceleration (266):   1.000000
    Device Accel Adaptive Deceleration (267):   1.000000
    Device Accel Velocity Scaling (268):    10.000000
    Device Node (257):  "/dev/input/event13"
    Wacom Tablet Area (289):    0, 0, 26312, 16520
    Wacom Rotation (290):   0
    Wacom Pressurecurve (291):  0, 0, 100, 100
    Wacom Serial IDs (292): 147, 0, 10, 0, 0
    Wacom Serial ID binding (293):  0
    Wacom Pressure Threshold (294): 27
    Wacom Sample and Suppress (295):    2, 4
    Wacom Enable Touch (296):   1
    Wacom Enable Touch Gesture (298):   0
    Wacom Touch Gesture Parameters (299):   0, 0, 250
    Wacom Tool Type (300):  "ERASER" (308)
    Wacom Button Actions (301): "Wacom button action 0" (302), "Wacom button action 1" (303), "Wacom button action 2" (304)
    Wacom button action 0 (302):    1572865
    Wacom button action 1 (303):    1572866
    Wacom button action 2 (304):    1572867
    Wacom Pressure Recalibration (305): 1
    Device Product ID (258):    1386, 147
    Wacom Debug Levels (306):   0, 0
$ xinput list-props 15
Device 'Wacom Serial Penabled 1FG Touchscreen touch':
    Device Enabled (136):   1
    Coordinate Transformation Matrix (138): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    Device Accel Profile (265): 0
    Device Accel Constant Deceleration (266):   1.000000
    Device Accel Adaptive Deceleration (267):   1.000000
    Device Accel Velocity Scaling (268):    10.000000
    Device Node (257):  "/dev/input/event13"
    Wacom Tablet Area (289):    0, 0, 26312, 16520
    Wacom Rotation (290):   0
    Wacom Pressurecurve (291):  0, 0, 100, 100
    Wacom Serial IDs (292): 147, 0, 3, 0, 0
    Wacom Serial ID binding (293):  0
    Wacom Pressure Threshold (294): 27
    Wacom Sample and Suppress (295):    2, 4
    Wacom Enable Touch (296):   1
    Wacom Enable Touch Gesture (298):   0
    Wacom Touch Gesture Parameters (299):   0, 0, 250
    Wacom Tool Type (300):  "TOUCH" (309)
    Wacom Button Actions (301): "Wacom button action 0" (302), "Wacom button action 1" (303), "Wacom button action 2" (304)
    Wacom button action 0 (302):    1572865
    Wacom button action 1 (303):    1572866
    Wacom button action 2 (304):    1572867
    Device Product ID (258):    1386, 147
    Wacom Debug Levels (306):   0, 0

Try this as your config:

[input]
touchscreen_device = Wacom Serial Penabled 1FG Touchscreen touch

[touch]
regex = Wacom Serial Penabled 1FG Touchscreen.*id=(\d+).*

(Note the replacement of : with = in the touch.regex config parameter to match the output of xinput.)

By the way, it looks like the docs are a little misleading. #108 should fix the regexes in the docs.

Great, that works. Screen and wacom rotation are working with the thinkpad-rotate command, though the acpid triggers aren't working at the moment. I will try and do some troubleshooting and try and figure it out.

Most likely, the ACPI hooks are not working for your computer because the events are named differently on the X200 than the X220. The easiest way to see the ACPI events generated by your computer is to run:

sudo acpi_listen

and then perform the triggers (lower the lid into tablet mode, raise the lid out of tablet mode, and press the mute button). This should display the events that should be used by the hooks. Please post the output here.

$ sudo acpi_listen
video/tabletmode TBLT 0000008A 00000001
video/tabletmode TBLT 0000008A 00000000

I just want to mention that we have a bit of documentation for that as well.

The second rotate ACPI hook hoes this exact signature:

event=video/tabletmode TBLT 0000008A 0000000[01].*
action=/usr/bin/thinkpad-rotate-hook %e

I do not really see why this does not work from the hook. However, the hook is not working on my machine either. So far I thought this was due to my workaround which I had to do because something in Ubuntu makes the screen black when rotating it. @jturner314, does the hook work for you?

I write the last exam in five hours and will be done in eight hours. Then I can look into this a bit more closely.

@martin-ueding The rotation hook does work for me.

@samanthacm As Martin pointed out, those events match one of the hooks included in thinkpad-scripts, so the problem is not differing event names. I suggest:

  1. Make sure that acpid is running.
  2. See if there's anything relevant in your syslog when you lay down your screen into tablet mode.

This is what I get when I run acpid in debug mode for more verbosity. Nothing shows up in journalctl on the events. I removed /etc/acpid/events/anything but otherwise no other changes to acpid.

$ sudo acpid -f -d
Deprecated /proc/acpi/event was not found.  Trying netlink and the input layer...
input layer /dev/input/event0 (AT Translated Set 2 keyboard) opened successfully, fd 4
input layer /dev/input/event1 (Lid Switch) opened successfully, fd 5
input layer /dev/input/event2 (Sleep Button) opened successfully, fd 6
input layer /dev/input/event3 (Power Button) opened successfully, fd 7
input layer /dev/input/event4 (Video Bus) opened successfully, fd 8
input layer /dev/input/event5 (ThinkPad Extra Buttons) opened successfully, fd 9
input layer /dev/input/event6 (HDA Intel Mic) opened successfully, fd 10
input layer /dev/input/event7 (HDA Intel Dock Mic) opened successfully, fd 11
input layer /dev/input/event8 (HDA Intel Dock Headphone) opened successfully, fd 12
input layer /dev/input/event9 (HDA Intel Headphone) opened successfully, fd 13
inotify fd: 14
inotify wd: 1
netlink opened successfully
acpid: starting up with netlink and the input layer
parsing conf file /etc/acpi/events/thinkpad-rotate-acpi
acpid: skipping incomplete file /etc/acpi/events/thinkpad-rotate-acpi
parsing conf file /etc/acpi/events/thinkpad-radiosw
parsing conf file /etc/acpi/events/thinkpad-mutemic-acpi-hook
parsing conf file /etc/acpi/events/thinkpad-rotate-acpi-hook-2
parsing conf file /etc/acpi/events/thinkpad-rotate-acpi-hook-1
acpid: 4 rules loaded
acpid: waiting for events: event logging is off
acpid: client connected from 13039[1000:1000]
acpid: 1 client rule loaded
Traceback (most recent call last):
  File "/usr/bin/thinkpad-rotate-hook", line 9, in <module>
    load_entry_point('thinkpad-scripts==4.4.0', 'console_scripts', 'thinkpad-rotate-hook')()
  File "/usr/lib/python3.4/site-packages/tps/hooks.py", line 115, in main_rotate_hook
    ], logger)
  File "/usr/lib/python3.4/site-packages/tps/__init__.py", line 133, in wrapper
    local_logger.debug('subprocess “{}”'.format(' '.join(command)))
TypeError: sequence item 2: expected str instance, NoneType found
Traceback (most recent call last):
  File "/usr/bin/thinkpad-rotate-hook", line 9, in <module>
    load_entry_point('thinkpad-scripts==4.4.0', 'console_scripts', 'thinkpad-rotate-hook')()
  File "/usr/lib/python3.4/site-packages/tps/hooks.py", line 115, in main_rotate_hook
    ], logger)
  File "/usr/lib/python3.4/site-packages/tps/__init__.py", line 133, in wrapper
    local_logger.debug('subprocess “{}”'.format(' '.join(command)))
TypeError: sequence item 2: expected str instance, NoneType found
sudo c^Cacpid: exiting
[samantha@athena events]$ ls
thinkpad-mutemic-acpi-hook  thinkpad-rotate-acpi-hook-1
thinkpad-radiosw            thinkpad-rotate-acpi-hook-2
thinkpad-rotate-acpi
[samantha@athena events]$ rm -r thinkpad-rotate-acpi
rm: remove write-protected regular file ‘thinkpad-rotate-acpi’? y
rm: cannot remove ‘thinkpad-rotate-acpi’: Permission denied
[samantha@athena events]$ sudo rm -r thinkpad-rotate-acpi
[samantha@athena events]$ sudo acpid -f -d
Deprecated /proc/acpi/event was not found.  Trying netlink and the input layer...
input layer /dev/input/event0 (AT Translated Set 2 keyboard) opened successfully, fd 4
input layer /dev/input/event1 (Lid Switch) opened successfully, fd 5
input layer /dev/input/event2 (Sleep Button) opened successfully, fd 6
input layer /dev/input/event3 (Power Button) opened successfully, fd 7
input layer /dev/input/event4 (Video Bus) opened successfully, fd 8
input layer /dev/input/event5 (ThinkPad Extra Buttons) opened successfully, fd 9
input layer /dev/input/event6 (HDA Intel Mic) opened successfully, fd 10
input layer /dev/input/event7 (HDA Intel Dock Mic) opened successfully, fd 11
input layer /dev/input/event8 (HDA Intel Dock Headphone) opened successfully, fd 12
input layer /dev/input/event9 (HDA Intel Headphone) opened successfully, fd 13
inotify fd: 14
inotify wd: 1
netlink opened successfully
acpid: starting up with netlink and the input layer
parsing conf file /etc/acpi/events/thinkpad-radiosw
parsing conf file /etc/acpi/events/thinkpad-mutemic-acpi-hook
parsing conf file /etc/acpi/events/thinkpad-rotate-acpi-hook-2
parsing conf file /etc/acpi/events/thinkpad-rotate-acpi-hook-1
acpid: 4 rules loaded
acpid: waiting for events: event logging is off
acpid: client connected from 13039[1000:1000]
acpid: 1 client rule loaded
Traceback (most recent call last):
  File "/usr/bin/thinkpad-rotate-hook", line 9, in <module>
    load_entry_point('thinkpad-scripts==4.4.0', 'console_scripts', 'thinkpad-rotate-hook')()
  File "/usr/lib/python3.4/site-packages/tps/hooks.py", line 115, in main_rotate_hook
    ], logger)
  File "/usr/lib/python3.4/site-packages/tps/__init__.py", line 133, in wrapper
    local_logger.debug('subprocess “{}”'.format(' '.join(command)))
TypeError: sequence item 2: expected str instance, NoneType found
Traceback (most recent call last):
  File "/usr/bin/thinkpad-rotate-hook", line 9, in <module>
    load_entry_point('thinkpad-scripts==4.4.0', 'console_scripts', 'thinkpad-rotate-hook')()
  File "/usr/lib/python3.4/site-packages/tps/hooks.py", line 115, in main_rotate_hook
    ], logger)
  File "/usr/lib/python3.4/site-packages/tps/__init__.py", line 133, in wrapper
    local_logger.debug('subprocess “{}”'.format(' '.join(command)))
TypeError: sequence item 2: expected str instance, NoneType found
``

That is a Python traceback from our program. The ACPI hook gets called, it just crashed rather soon. We will have to look into it. I will finish up a C++ project and then look at this tomorrow I think.

I think the problem is that thinkpad-rotate-hook uses who -u to try to determine the currently active graphical user, but this is not reliable. I happen to always have a terminal window open, so it always works for me.

I did some searching, and the most reliable solution I can find is to search for the user running the X server. This works for me and I think should work in most cases:

$ pgrep -f '^/usr/(local/)?(bin|lib)/([^[:blank:]]+/)?(Xorg|X)([[:blank:]]+|$)'
940
$ ps --no-headers --format=ruser 940
jim

@martin-ueding What do you think?

I just looked through the code. Having a None in position 2 (zero indexed I hope) means that get_graphicsl_user() did not go through the branch which returns anything. Therefore the return type is None. But I think you just figured that out four hours ago as well 😄.

I have implemented your idea as a fall-back in the hooks.get_graphicsl_user function. There is a problem on my machine, though: Ubuntu runs X as root. I think is caused by the used of a display manager. This is the command line of X:

/usr/bin/X :0 -auth /var/run/sddm/:0 -nolisten tcp -background none -noreset vt7

@samanthacm, please check which user is running X on your machine. This can be done using Jim's command line:

ps --no-headers --format=ruser $(pgrep -f '^/usr/(local/)?(bin|lib)/([^[:blank:]]+/)?(Xorg|X)([[:blank:]]+|$)')

If that is your user account, you could checkout the branch feature/robust-hook-user. Run python3 -m tps.hooks in the source directory. It should print your user name as well. If that works, install it on your machine. It should then work.

root can occur on my machine, and it does not make sense to call the script as root then. I let the hook fail if the first method (who -u) failed and the second method gave root as a result. We would need to have another method, then.

It makes sense that the real user could be root when using a display manager, but I would be surprised if the X server is actually run as root. What is the effective user? (Use euser instead of ruser in the call to ps, like this: ps --no-headers --format=euser 940.) Is the X server named something different on your computer?

By the way, I also came across this project which uses loginctl to determine the currently active X session. It doesn't work for me, though, I think because I don't use a display manager.

It does not work for me either for some reason. Their code reminds me of the Bash version of this project. I am so glad that we took the plunge and rewrote it in Python!

euser instead of ruser does not help, it still gives me root here.

I have implemented the thing with loginctl, it gives a sensible answer on my machine. @samanthacm should try that on her machine. Just call python3 -m tps.graphicaluser and it should give all the debug output as well as the user name found. The thing now goes through three different methods (loginctl, who and pgrep). It will also print the name of the function used.

Since there are now three methods, I moved this into its own Python module. By the way, how did the screen rotation turn out to have 2697 lines of code? 😀

I've a similar issue since the update one week ago (Oct. 15). Before, everything went perfect. Now, the mask for the wacom does not rotate with the screen (the touch-screen mask does the rotation). This happens when the rotation is done via hardware trigger or via terminal command. Sorry, I've no clue where to start. Please tell me which information I should provide. Thank you in advance.

By the way, what is the command to rotate the wacom mask?

@florianfroewis

Will you please create a new issue for the problem you're experiencing? (This thread is getting pretty long.)
The following information would be helpful:

  • Your OS distribution (e.g. Ubuntu 14.04) and model name of your computer (e.g. X220 tablet).
  • The versions of thinkpad-scripts before and after the update that caused the issue.
  • The contents of your config file (if you have one) located at ~/.config/thinkpad-scripts/config.ini.
  • The output of xinput list.
  • The output of xinput list-props <ID> for each of your Wacom devices, where each device's <ID> is given by the output of the previous command.
  • The output of thinkpad-rotate -vv --force-direction cw when the tablet is in the normal orientation.
  • The output of thinkpad-rotate -vv --force-direction normal when the tablet is rotated.

To answer your question: thinkpad-scripts uses xinput to rotate the Wacom devices, but if you want to rotate them manually, the easiest way is to use xsetwacom. For example, xsetwacom set 10 Rotate cw will rotate device 10 clockwise 90 degrees.

Thanks. I opened a new issue here.

So what is the state of this issue here?

@samanthacm, is this still an ongoing issue? I guess if that has not been fixed for you, you just ditched thinkpad-scripts. If now, you could try the branch feature/use-xsetwacom-where-possible and see whether that fixes it.

I'll close this, in case there is some interest I can open it again.