# Synaptics TouchPad driver settings
if [ synclient=$(which synclient) -a -x $synclient];then
	# 2 finger scroll
	synclient HorizTwoFingerScroll=1 VertTwoFingerScroll=1 EmulateTwoFingerMinZ=40 EmulateTwoFingerMinW=8 2>/dev/null
  # Palm rejection
  synclient PalmDetect=1 PalmMinWidth=6 PalmMinZ=100
fi

# Synaptics TouchPad driver settings
if [[ synclient=$(type -tfp synclient) && -x $synclient ]];then
  if [[ $(xinput -list | grep "Synaptics TouchPad") ]];then
    # 2 finger scroll
    synclient HorizTwoFingerScroll=1 VertTwoFingerScroll=1 EmulateTwoFingerMinZ=40 EmulateTwoFingerMinW=8 2>/dev/null
    # Palm rejection
    synclient PalmDetect=1 PalmMinWidth=6 PalmMinZ=100 2>/dev/null
  fi
fi

Add some condition to prevent error messages.
Add some condition to prevent error messages.

There's such a case that synclient is executable but no synaptic driver is
loaded. So, I check the list of input devices and grep synaptic device.
If nothing found, no execute synclient commands.
