-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
    @singrium "duplicate" in turn refers to a documentation page where reference is still made to gnome-session-properties. In other words: outdated. – vanadium Dec 27 '19 at 15:46
  • @singrium no i want to disable it permanently – Teja Dec 27 '19 at 15:55
  • 2
    You can add that command to startup applications so every time you open your PC, the command will be automatically run at startup and by this the touch screen will be disabled. Check this answer – singrium Dec 27 '19 at 16:02
  • try xinput

    then locate your touchscreens number #

    xinput disable #

    I think that is permanent. If not then make a script and put it in startup apps, which is what I have done. funny enough my touch pen works. a much better experience IMO without the touchscreen, being touchy, going awry.

    power key, "start", "startup applications", add button.

    bash "/home/MyScripts/DisableTouchscreen.sh"

    my script is for my display ELAN, so you wont need the number. note that those numbers can change on reboot.

    – pierrely Dec 29 '19 at 04:49
  • #!/bin/bash touchscreen="" pen=""

    OIFS=$IFS search=""ELAN0732:00""

    note that the pen didnt show up until I mapped the standard one or clicked the screen.

    so need to do that first

    echo $search

    list=$(xinput | grep $search | grep pointer) echo "list $list"

    if [ -f tempxinput.txt ] then
    echo " removing tempxinput" rm tempxinput.txt fi

    device_id=$(echo "$list" | sed -n 's/.ELAN0732:00.id=([0-9])./\1/p')

    for i in $device_id do echo "id is $i" xinput disable $i done

    if that is an answer, I can put it in as such and tidy up the script

    – pierrely Dec 29 '19 at 04:49

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
  • 88,010