#!/usr/bin/sh kb=$(xinput | grep "AT Translated Set 2 keyboard" | egrep -o "id=[0-9]+" | cut -f2 -d=) tp=$(xinput | grep "TouchPad" | egrep -o "id=[0-9]+" | cut -f2 -d=) if xinput list-props $kb | grep Enabled | head -n1 | egrep -q "1$"; then xinput disable $kb xinput disable $tp else xinput enable $kb xinput enable $tp fi