LinuxCommandLibrary

wmctrl

Command-line window manager control

TLDR

List windows

$ wmctrl -l
copy
Activate window by title
$ wmctrl -a [window_title]
copy
Move window and focus
$ wmctrl -R [window_title]
copy
Switch workspace
$ wmctrl -s [workspace_number]
copy
Toggle fullscreen
$ wmctrl -r [window_title] -b toggle,fullscreen
copy
Move window to workspace
$ wmctrl -r [window_title] -t [workspace_number]
copy

SYNOPSIS

wmctrl [OPTIONS]

DESCRIPTION

wmctrl is a command-line tool for interacting with an X Window Manager that supports the EWMH/NetWM specification. It allows listing, switching, and manipulating windows from scripts or the terminal.
Window titles can be partial matches. Multiple actions can be combined.

PARAMETERS

-l

List windows
-a TITLE
Activate window matching title
-R TITLE
Move window to current workspace and focus
-s N
Switch to workspace N
-r TITLE
Select window for action
-b ACTION
Modify window state (toggle, add, remove)
-t N
Move window to workspace N

CAVEATS

X11 only. Requires EWMH-compliant window manager. Some features depend on window manager support.

SEE ALSO

xdotool(1), xprop(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community