The wmctrl program is a UNIX/Linux command line tool to interact with an EWMH/NetWM compatible X Window Manager.
wmctrl can
List windows -r
List desktops -d
Switch desktops -s
Activate window -a
Move window -R -r
Showing the desktop -k (on|off)
wmctrl help
ref. jserv: wmctrl - 對符合 EWMH 的 WM 傳送命令