I know that getting your touchpad disabled is as easy as toggling the on/off button in System Settings, but unfortunately it only works for the current session. After a reboot, the touchpad is back on.
I know that getting your touchpad disabled is as easy as toggling the on/off button in System Settings, but unfortunately it only works for the current session. After a reboot, the touchpad is back on.
The command to disable touchpad is:
for 14.04:
gsettings set org.gnome.settings-daemon.peripherals.touchpad touchpad-enabled false
for 15.04 +:
gsettings set org.gnome.desktop.peripherals.touchpad send-events disabled
The most pragmatic (and simple) solution then is to add the command to Startup Applications.
Like in many cases when commands involve screen, xrandr
, keyboard or touchpad settings, You will need to add a small break however to prevent possible local procedures to overrule the command, so it should be:
for 14.04:
/bin/bash -c "sleep 15 && gsettings set org.gnome.settings-daemon.peripherals.touchpad touchpad-enabled false"
for 15.04+:
/bin/bash -c "sleep 15 && gsettings set org.gnome.desktop.peripherals.touchpad send-events disabled"
Open Dash > Startup Applications > Add. Add the command above, according to your Ubuntu version.
Now shortly after login (within 15 seconds) your touchpad is disabled automatically.
Of course you can play with the 15 seconds a bit to optimize for your system.
From your comment, it turns out the touchpad is (re-) enabled after a while, which means some process is enabling the touchpad.
Usually, it is extremely difficult to find out which process is causing this kind of changes. Even if you could, it would not be sure you could eliminate the cause.
The good news however is that gsettings
(which is used to check/control the touchpad) is extremely "low on juice". That means that it will be no burden to your system whatsoever to have a background script keep an eye on the current state, immediately disabling the touchpad again if it is enabled somehow by some process.
#!/usr/bin/env python3
import subprocess
import time
key = "org.gnome.settings-daemon.peripherals.touchpad"
def check_set():
currstate = subprocess.check_output([
"gsettings", "get", key, "touchpad-enabled",
]).decode("utf-8").strip()
if currstate == "true":
subprocess.Popen([
"gsettings", "set", key, "touchpad-enabled", "false"])
while True:
time.sleep(2)
check_set()
#!/usr/bin/env python3
import subprocess
import time
key = "org.gnome.desktop.peripherals.touchpad"
def check_set():
currstate = subprocess.check_output([
"gsettings", "get", key, "send-events",
]).decode("utf-8").strip()
if currstate == "enabled":
subprocess.Popen([
"gsettings", "set", key, "send-events", "disabled"])
while True:
time.sleep(2)
check_set()
no_touchpad.py
Add the following command to Startup Applications:
/bin/bash - c "sleep 15 && python3 /path/to/no_touchpad.py"
I am afraid the only alternative is to disconnect the touchpad physically, as mentioned by Serg.