wmctrl

Interact with EWMH/NetWM compatible X11 window managers

brewmacoslinux
Try with needOr install directly
Source

About

UNIX/Linux command-line tool to interact with an EWMH/NetWM

Commands

wmctrl

Examples

List all open windows with their window IDs and properties$ wmctrl -l
Activate a specific window by its name$ wmctrl -a 'Firefox'
Move a window to a specific desktop (workspace 0)$ wmctrl -i -r <window_id> -b add,maximized_vert,maximized_horz