Skip to content

Instantly share code, notes, and snippets.

@jamespo
Created June 2, 2016 20:09
Show Gist options
  • Save jamespo/b74f59ed86b381ca45928e6c125fd464 to your computer and use it in GitHub Desktop.
Save jamespo/b74f59ed86b381ca45928e6c125fd464 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# synclient-to-x.py - export synclient -l output to
# x.org config file [c] jamespo [at] gmail [dot] com
# USAGE: synclient -l | ./synclient-to-x.py > 50-synaptics.conf
from __future__ import print_function
import fileinput
print("""
Section "InputClass"
Identifier "touchpad"
Driver "synaptics"
MatchIsTouchpad "on" """)
for line in fileinput.input():
fields = line.strip().split('=')
try:
print(' "%s" "%s"' %
(fields[0].strip(), fields[1].strip()))
except IndexError:
pass
print('EndSection')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment