Ubuntu – Enable/disable touchpad

asusshortcut-keystouchpad

I managed to install Ubuntu 16.04 on my asus ux501 vw, but some of my shortcut are not working.
I'm not looking to fix them all, but just one : the shortcut which allow me to enable or disable touchpad, so i can write long documents with working about the touchpad.

I tried to find it on google but I got nothing.

Can someone explain me how to fix that please?
Thanks !

Best Answer

I created this bash script from negusp's answer. It finds and toggles TouchPad device. You can configure a custom shortcut to it in system settings.

#!/bin/bash

read TPdevice <<< $( xinput | sed -nre '/TouchPad|Touchpad/s/.*id=([0-9]*).*/\1/p' )
state=$( xinput list-props "$TPdevice" | grep "Device Enabled" | grep -o "[01]$" )

if [ "$state" -eq '1' ];then
    xinput --disable "$TPdevice" && notify-send -i emblem-nowrite "Touchpad" "Disabled"
else
    xinput --enable "$TPdevice" && notify-send -i input-touchpad "Touchpad" "Enabled"
fi

I'm setting Ctrl+Shift+F9 for toggle touchpad enable and disable like this:

enter image description here

Update: You may need to make your script to executable with command chmod +x filename or input /bin/bash /filepath to Command field of Custom shortcut window.