I have a shell script to configure Synaptics touchpad settings at login.
You configure the touchpad with the
synclient command. Its usage is
synclient [-lV?] [var1=value1 [var2=value2] ...]
synclient PalmDetect=1— to set a single setting
synclient PalmDetect=1 PalmMinZ=10— to set multiple
I'm trying to use my script itself as a configuration file by playing around with heredocs and grep. The script greps out all comment lines (starting with
#) and then passes everything in the heredoc as arguments to
synclient. Is this code clean? How could I improve it?
#!/bin/sh # script to configure Synaptic touchpad settings # This script treats itself as a configuration file. << END_OF_SETTINGS grep -v '^#' | xargs synclient # Try to disable touchpad while typing PalmDetect=1 PalmMinZ=100 # Allow three-finger middle button tap, click TapButton3=2 ClickFinger3=2 END_OF_SETTINGS