Making changes permanent for touch screen

I've installed evdev and xinput-calibrator to great success. Everything in working wonderfully to make a TV a touch-screen monitor for work project. But........WHERE DO I MAKE THE CALIBRATION PERMANENT OR RUN ON STARTUP?????????? Sorry for the yelling, but everywhere I look (forums, et al) they say to use a conf file that doesn't exist, or one site just says use evdev instead of libinput (I believe its this forum) but that doesn't save it.
So, when I get the output from xinput, how do I make that load on startup on the current version of Mate on Pi 3b?

The config file doesn't exist initially., so it's expected to create the file. xinput-calibrator doesn't touch the config saved on disk.

  1. Run xinput-calibrator in the terminal. Copy the output after calibrating.

    (It'll say something like "copy the snippet below")

  2. Run:

    sudo nano /etc/X11/xorg.conf.d/99-calibration.conf
    
  3. Press CTRL+SHIFT+V to paste the contents. It might look like this:

    Section "InputClass"
    Identifier "calibration"
    MatchProduct "eGalax Inc. USB TouchController"
    Option "Calibration" "121 1917 317 1741"
    Option "SwapAxes" "1"
    EndSection

  4. Press CTRL+X then Y to save and close the file.


If that path doesn't save the calibration settings across reboots, try this file instead -- (from Raspbian forums)

sudo nano /usr/share/X11/xorg.conf.d/01-input.conf
1 Like

will paste the output later, as it doesn't match that output since I'm using evdev. But thanks for the guidance on the files.

Had to reinstall Mate on the pi, but here is the ouput from terminal:

Install the 'xinput' tool and copy the command(s) below in a script that starts with your X session
xinput set-int-prop "Touch Device FC42WH00DL-CT-B2-10P" "Evdev Axis Calibration" 32 1064 31513 1437 30026
xinput set-int-prop "Touch Device FC42WH00DL-CT-B2-10P" "Evdev Axes Swap" 8 0

It says to make a script (above my head at moment and couldn't find example on forums) and make it load at startup.

There's two ways with xinput:

Simple - As soon as you log on

You could have the calibration set as soon as you load the desktop. Add these commands to Start-up Applications via MATE's Control Center. No scripting required.

image

The only drawback is that this only works for a single user session which auto logins, skipping the login screen.


As soon as X starts (the display server)

This is where you'd need to create a script, then add a file to X.org's config to run as soon as the graphical environment starts (after the splash screen)

  1. Create the script:

    sudo nano /usr/local/bin/calibrate-touchscreen.sh
    
  2. Paste your output with the "shebang" at the top:

    #!/bin/bash
    xinput set-int-prop "Touch Device FC42WH00DL-CT-B2-10P" "Evdev Axis Calibration" 32 1064 31513 1437 30026
    xinput set-int-prop "Touch Device FC42WH00DL-CT-B2-10P" "Evdev Axes Swap" 8 0
    
  3. Make it executable:

    sudo chmod +x /usr/local/bin/calibrate-touchscreen.sh
    
  4. Create a config file so Xorg loads it:

    sudo nano /etc/lightdm/lightdm.conf.d/99-calibrate-touchscreen.sh
    
  5. Paste this:

    [Seat:*]
    display-setup-script = /usr/local/bin/calibrate-touchscreen.sh
    

Reference:

2 Likes