

xdotool
17 likes
This tool lets you simulate keyboard input and mouse activity, move and resize windows, etc. It does this using X11's XTEST extension and other Xlib functions.
Features
xdotool News & Activities
Highlights • All activities
Recent activities
- POX added xdotool as alternative to Hammerflow
Comments and Reviews
These commands will report pid for active window every 1 second without errors.
Only active window switch and not mouse hover! These commands will not capture actions that are faster than the delay.
while true; do sleep 1; xdotool getactivewindow getwindowpid 2/dev/null; done
Definitely does not come close to what AHK does. It does do a lot of window-related stuff but falls VERY short in the hotkey-specific things. xbindkeys combined with this helps, but still reaches nowhere near the level of AHK.
sleek, nifty and powerful utility that (when used in scripts) makes up for the lack of
AutoHotkey under Linux.