How do you do things that are similar to AutoHotkey, but under Linux?

command-line utilties for sending XTEST commands and similar

command-line utilities for getting info (ie. mostly read-only) about GUI windows / events / etc

things that can trigger off of the keyboard / mouse

unknown if these are related