Last active
August 31, 2023 00:26
-
-
Save Kaveh8/0ad331a9e1a26d056b0e574c69d9487a to your computer and use it in GitHub Desktop.
A bash script for disabling touchpad in Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mouse=`xinput | grep 'Mouse' | cut -d$'\t' -f2` | |
touch=`xinput | grep 'Touchpad' | cut -d$'\t' -f2` | |
echo 'Mouse' $mouse | |
echo 'Touch' $touch | |
mouse_id=`echo $mouse | cut -d '=' -f 2` | |
touch_id=`echo $touch | cut -d '=' -f 2` | |
mouse_prop_id=`xinput list-props $mouse_id | grep 'Device Enabled' | cut -d '(' -f 2 | cut -d ')' -f 1` | |
touch_prop_id=`xinput list-props $touch_id | grep 'Device Enabled' | cut -d '(' -f 2 | cut -d ')' -f 1` | |
echo | |
echo 'Mouse'`xinput list-props $mouse_id | grep 'Device Enabled'` | |
echo 'Touch'`xinput list-props $touch_id | grep 'Device Enabled'` | |
echo | |
xinput set-prop $mouse_id $mouse_prop_id 0 | |
xinput set-prop $touch_id $touch_prop_id 0 | |
echo '*****************************************' | |
echo | |
echo 'Mouse'`xinput list-props $mouse_id | grep 'Device Enabled'` | |
echo 'Touch'`xinput list-props $touch_id | grep 'Device Enabled'` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment