Script to toggle touchpad
I don't understand the purpose of substr($3, 1) — isn't that the same as $3?

AWK alone can do the work of grep, tail, and negation.  I would write it this way:

synclient TouchpadOff=$(synclient | awk '/TouchpadOff/ { off=int($3) }
                                         END           { print !off }')