-1

Recently i have moved to ubuntu from windows. I have a problem with my touch screen so i have disabled it by xinput command. But whenever my system is restarted the driver is getting enabled. Please help me regarding this.

Teja
  • 1

1 Answers1

0

You successfully found the command that can disable your touch screen. Other questions indicate how that can be found

To have this command automatically executed when you log in, add it to your autostart applications. These applications are defined by .desktop launcher files that reside in the hidden folder .config/autostart in your home folder.

In older Ubuntu versions, a graphical tool, gnome-session-properties, allowed to create such .desktop files. This tool, however, is not included in recent Ubuntu versions. However, you can easily create such a .desktop folder yourself using a text editor.

1. Create a desktop file

Open your editor, paste the following snippet and fill it out:

#!/usr/bin/env xdg-open
[Desktop Entry]
Categories=Utility;
Comment=
Exec=
Icon=
Name=
StartupNotify=false
Type=Application
Version=1.0
X-GNOME-Autostart-enabled=true
Hidden=false

You can fill out the Comment=, Icon= and Name= fields as you see fit, and probably these lines can also be removed. Important is your Exec= line: complete that with the command you need to execute to disable the touch screen. The line X-GNOME-Autostart-enabled=true is optional, but if it is there, should be set to true. Replace by "false" to prevent the laucher from being run during start up. Hidden=false also is optional. If you would set it to true, the effect would be the same as deleting the launcher altogether.

Save the text file as, for example, notouchscreen.desktop.

2. Move the desktop file to your startup folder

To be in effect, the file should reside in .config/autostart in your home folder. .config is a hidden folder. You can see it by revealing "hidden files" in the file manager. You can just press Ctrl+h to toggle the visibility of hidden files and folders. Under config, you will find the autostart folder. Move the file there.

Logout and log back in. When you logged back in, the touch screen should have been disabled automatically.

Delaying your command if needed

If it did not work, you may need to insert a little delay in the command so that it is executed only when your desktop is loaded. That is possible with a "sleep" command. To delay running your command for 3 seconds, use the following Exec= line:

Exec=sh -c "sleep 3 && put your command here"

Run the autostart command for all users on the system

This will disable the touch screen for your current user only. If you want this to work for all users, then you must repeat this for each account. Alternatively, if you have root (administrator) privileges, then move your .desktop file to `/etc/xgd/autostart/', where lauchers reside that are run when any user logs in.

vanadium
  • 97,564