Skip to content

Instantly share code, notes, and snippets.

@flozz
Last active August 24, 2017 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flozz/c377d2ce805a5b11d151a87e56771cd5 to your computer and use it in GitHub Desktop.
Save flozz/c377d2ce805a5b11d151a87e56771cd5 to your computer and use it in GitHub Desktop.
Disables the touchpad of the Thinkpad X1 Carbon under X11. It probably wroks with other PC too.
#!/usr/bin/env python
## DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
## Version 2, December 2004
##
## Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
##
## Everyone is permitted to copy and distribute verbatim or modified
## copies of this license document, and changing it is allowed as long
## as the name is changed.
##
## DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
## TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
##
## 0. You just DO WHAT THE FUCK YOU WANT TO.
"""
This script disables the touchpad of the Thinkpad X1 Carbon under X11. It
probably works with other PC too.
"""
import subprocess
input_id = subprocess.check_output(["xinput", "list", "--id-only", "SynPS/2 Synaptics TouchPad"])
input_id = input_id.strip()
subprocess.check_call(["xinput", "set-prop", input_id, "Device Enabled", "0"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment