Disabling a touchscreen at start of login screen?

I have been given an Acer Aspire E5-511P laptop. I’m convinced it has faulty touchscreen hardware because in both Windows 10 and Manjaro i3 the cursor will randomly jitter by itself at the top right corner of the screen and the touchpad cannot then easily control the cursor.

The laptop is usable though by disabling the touchscreen with an “xinput disable device_number” command. I currently have this command in ~/.profile.

However, the command obviously does not get run until user login time. I would like the command to get executed just before or during the lightdm login screen, because otherwise the cursor jitter is annoying at the login screen itself.

I have tried putting the disable command in the /etc/X11/xinitrc file but this did not work. I wonder where it should go to affect X at the login screen - possibly in the /etc/lightdm directory but where I am uncertain??

Any help appreciated…

Hi @lagagnon,

I figure you’ll have create a systemd unit that starts up automatically and runs the command.

Edit:
This might help: Create a simple systemd service unit file and run a script on boot | Support | SUSE

You can make a script that runs before lightdm is started:

sudo nano /usr/local/bin/disable-touchscreen.sh

Copy paste these contents in there:

#!/bin/bash

xinput disable <device_number>

Make it executable:

sudo chmod +x /usr/local/bin/disable-touchscreen.sh

Now open /etc/lightdm/lightdm.conf as root and uncomment these lines in the file:

[Seat:*] #remove the line which were here

display-setup-script = /usr/local/bin/disable-touchscreen.sh

Reboot

Thanks! That works perfectly.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.