Ask Your Question

Rick Stevens's profile - activity

2018-07-04 13:36:38 -0500 received badge  Teacher (source)
2012-03-02 19:14:17 -0500 answered a question How disable the touchpad

The above answers work if you have a Syaptics-style touchpad. My Dell N7110 doesn't use a Synaptics touchpad but uses something that simply identifies itself as a "PS/2 Mouse". To be able to toggle the touchpad on and off, become root and install this script as /usr/bin/toggleTouchPad:

# toggleTouchpad by Brendon Dugan
# Toggles a touchpad on or off depending on it's current state or CLI argument
# To configure, run the command 'xinput list' in terminal and identify your
# touch pad.
# Using the output of the above command, change the touchpadString variable
# to a substring of your touchpad's description that is unique to that device.
# To run, simply type 'toggleTouchpad' to toggle your touchpad on or off, or
# 'toggleTouchpad on' to explicitly turn your touchpad on, or
# 'toggleTouchpad off' to explicitly turn it off.
# Enjoy!
touchpadString="PS/2 Generic Mouse"
touchpadID=$(xinput list | grep "$touchpadString" | awk -F " " '{print $6}' | awk -F "=" '{print $2}')
touchpadEnabled=$(xinput list-props $touchpadID | grep "Device Enabled" | awk -F ":" '{print $2}')

# Check for arguments on the command line
if [ $# -eq 1 ]; then               # Any arguments?
    arg1=$(echo $1 | tr [:upper:] [:lower:])    # Yes, convert to lower case
    cliArg=1                    # Set flag that we have one
else                        # There is no argument.
    cliArg=0                    # Clear flag

if [ $cliArg -eq 1 ]; then          # Did we get an argument?
    if [ $arg1 = 'on' ]; then           # Yes, was it "on"?
    xinput --set-prop $touchpadID "Device Enabled" 1
                        # Yes, enable the touchpad
    elif [ $arg1 = 'off' ]; then        # No, was it "off"?
    xinput --set-prop $touchpadID "Device Enabled" 0
                        # Yes, disable the touchpad
    else                    # None of the above, so...
    sleep 1                 # ...sleep one second, exit

else                        # No argument, toggle state
    if [ $touchpadEnabled -eq 1 ]; then     # Enabled now?
    xinput --set-prop $touchpadID "Device Enabled" 0
                        # Yes, so disable it
    else                    # Must be disabled, so...
    xinput --set-prop $touchpadID "Device Enabled" 1
                        # ...enable it

After saving it, change it to mode 655 ("chmod 755 /usr/bin/toggleTouchPad"). You will need to run the "xinput list" command and wiggle around on the touchpad to identify what it is, then put that string in the "touchpadString" variable in the script.

If you want to disable the touchpad, simply "$ toggleTouchPad off" or "$ toggleTouchPad on" to enable it. "$ toggleTouchPad" will toggle it between enabled and disabled.

Under XFCE/xfwm4, I use the "Fn-F3" (or "XF86TouchpadToggle") keystrokes to turn it on and off by going using the Configuration Editor ("Applications Menu->System->Configuration Editor), going to the keybindings section and adding a "custom0" with the following settings:

action /usr/bin/toggleTouchPad
binding XF86TouchpadToggle
name TouchpadOnOff

Hope that all helps.