Skip to content

Instantly share code, notes, and snippets.

@scottydelta
Created January 6, 2014 14:44
Show Gist options
  • Save scottydelta/8283730 to your computer and use it in GitHub Desktop.
Save scottydelta/8283730 to your computer and use it in GitHub Desktop.
Python script to disable and re-enable touch-pad in Xorg to fix touchpad freeze problem in Luna Elementary. Requires "sh" python module which can be installed using pip.
#!/usr/bin/env python
import sh,json
for line in sh.xinput("list"):
if "TouchPad" in line:
b = line.split()
idno = b[5]
idno = idno[3:]
for line in sh.xinput("list-props", int(idno)):
if "Enabled" in line:
c = line.split()
c = c[2]
idnoo = c[c.find("(")+1:c.find(")")]
sh.xinput("set-prop",int(idno),int(idnoo),0)
sh.xinput("set-prop",int(idno),int(idnoo),1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment