Last active
April 22, 2020 01:27
-
-
Save dyllandry/d7f7ba2b88807cb107c5fc608d3fe5ac to your computer and use it in GitHub Desktop.
Toggle a touchpad on/off.
This file contains hidden or 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/sh | |
| # Toggles a touchpad on/off. | |
| # Might only work computers that use xinput. | |
| DEVICE_NAME="SynPS/2 Synaptics TouchPad" | |
| ID=$(xinput list --id-only "$DEVICE_NAME") | |
| IS_ENABLED=$(xinput --list-props "$DEVICE_NAME" | grep "Device Enabled" | grep -o "[01]$") | |
| if [ $IS_ENABLED -eq 0 ]; then | |
| xinput set-prop $ID "Device Enabled" 1 | |
| echo "touchpad on" | |
| else | |
| xinput set-prop $ID "Device Enabled" 0 | |
| echo "touchpad off" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment