xdotool (fake X11 keyboard/mouse input)

This tool lets you programatically (or manually) simulate keyboard input and
mouse activity, move and resize windows, etc. It does this using X11's XTEST
extension and other Xlib functions.

Example: focus the firefox url bar

xdotool search "Mozilla Firefox" windowactivate --sync key --clearmodifiers ctrl+l
