Skip to content

Instantly share code, notes, and snippets.

@Soft
Created February 14, 2011 16:55
Show Gist options
  • Select an option

  • Save Soft/826152 to your computer and use it in GitHub Desktop.

Select an option

Save Soft/826152 to your computer and use it in GitHub Desktop.
Enables and Disables mouse
#!/bin/sh
state=`xinput --list-props $1 | sed -nr "s/.*Enabled \([0-9]+\):\s+([0-1]).*/\1/p"`
if [ "$state" = "1" ]; then
xinput --set-prop $1 "Device Enabled" 0
else
xinput --set-prop $1 "Device Enabled" 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment