I have a raspberry pi 4B attached to a 7" raspberry pi touchscreen via the provided ribbon cable. In my application, I have my touchscreen rotated 90° by using
display_rotate which is working correctly. The touchscreen input device needs to be separately rotated into the new coordinate system. I can do that locally by running the following
xinput set-prop 'raspberrypi-ts' 'Coordinate Transformation Matrix' 0, 1, 0, -1, 0, 1, 0, 0, 1
I want to run this command when the raspberry pi loads every time automatically, so I've edited my autostart file located in
@lxpanel --profile LXDE-pi @pcmanfm --desktop --profile LXDE-pi @chromium-browser localhost @xinput set-prop 'raspberrypi-ts' 'Coordinate Transformation Matrix' 0, 1, 0, -1, 0, 1, 0, 0, 1 @xscreensaver -no-splash
I'm able to run chromium automatically and load it to the requested page every time I restart the pi, but the touchscreen input is never rotated into the new coordinate system. If I enter the command into the terminal everything works like it should, but I really want it to happen automatically on boot.
Am I going about this the wrong way? Is there an issue with my formatting? Or is there a different location I should be adding this command so that it will be executed on load at the right time?
Thank you for your help in advance.