#!/bin/sh touchdev=$(xinput list --name-only|grep touch) || exit touchdev_enabled() { xinput list-props "$touchdev" | grep -q '(148):.1$' } if touchdev_enabled then cmd=disable else cmd=enable fi set -x xinput "$cmd" "$touchdev"