How to disable touchpad

Hello. I am new to Mabox and Openbox. I was wondering if there is a way to disable touchpad. Maybe a quick toggle? Thanks in advance.

1 Like

Hello @kckit1 and welcome to the forum,
this script should do the trick:

#!/bin/sh
# Toggle touchpad status
# Using libinput and xinput

# Use xinput list and do a search for touchpads. Then get the first one and get its name.
device="$(xinput list | grep -P '(?<= )[\w\s:]*(?i)(touchpad|synaptics)(?-i).*?(?=\s*id)' -o | head -n1)"

# If it was activated disable it and if it wasn't disable it
[[ "$(xinput list-props "$device" | grep -P ".*Device Enabled.*\K.(?=$)" -o)" == "1" ]] &&
    xinput disable "$device" ||
    xinput enable "$device"

Save it as ~/bin/toggle-touchpad.sh.
make it executable:

chmod +x ~/bin/toggle-touchpad.sh

and try.
Please let me know if it works for you. Maybe this script should be available by default in next Mabox releases.

4 Likes

Thanks for the welcome. I will try it and let you know if this works. Great work on the distro BTW!

2 Likes

Worked like a charm. Thanks again!

2 Likes