

If you can't move your mouse cursor, it's hard to get much done on your computer.īut don't fret. Put the following command under a custom shortcut: /bin/bash /path/to/toggle_touchpad.When your laptop touchpad stops working, it's easy to go into a panic. Just to be complete, and because OP indicated the python script(s) worked, but not wanted to use python, the bash version(s) of the two toggle scripts: We can make the script set the opposite value, and thus toggle the touchpad. (14.04), or gsettings get .touchpad send-events If we use a script to read the current settings by the command: gsettings get .touchpad touchpad-enabled Click the "+" and add the command: python3 /path/to/toggle_touchpad.pyįor 14.04: gsettings set .touchpad touchpad-enabled falseįor 15.04 +: gsettings set .touchpad send-events disabled Copy the script above, for your correct Ubuntu version, into an empty file, save it as toggle_touchpad.pyĪdd the following command to a shortcut: python3 /path/to/toggle_touchpad.pyĬhoose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts".Newval = "disabled" if curr = "'enabled'" else "enabled"

Newval = "false" if curr = "true" else "true" Key = ".touchpad" val = "touchpad-enabled"Ĭurr = subprocess.check_output().decode("utf-8").strip() Since you can enable/disable touchpad from System Settings, and I am pretty sure System Settings does use gsettings, it looks like the method below should do the job, on your Dell as well. If you can change settings by gsettings, generally it is the preferred option. Notify-send -u low -i mouse "Trackpad enabled" Notify-send -u low -i mouse "Trackpad disabled" If xinput list-props 13 | grep "Device Enabled (168).*1" >/dev/null I've attached this to a shortcut key and it works a charm.

You can do it in a one liner, but this way you get a nice notification, too. I have used 15 for $DEVICE_ID EDIT - thanks to the answer below here's my toggle script but I want to be able to map this to a keyboard shortcut, so I'm looking for a command line solution.īonus points if you answer works in Gnome-Shell as well as Unity :-) EDIT: output of xinput as requested in comment. It still works! $ xinput set-prop $DEVICE_ID "Device Enabled" 0

I am trying to tweak the touchpad on Ubuntu 16.04 but none of the usual methods seem to work.
