← 返回命令列表

Linux command

wmctrl 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

List

wmctrl -l

Activate

wmctrl -a [window_title]

Move

wmctrl -R [window_title]

Switch

wmctrl -s [workspace_number]

Example

wmctrl -r [window_title] -b toggle,fullscreen

Example

wmctrl -r [window_title] -t [workspace_number]

说明

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.

参数

-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

FAQ

What is the wmctrl command used for?

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.

How do I run a basic wmctrl example?

Run `wmctrl -l` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -l do in wmctrl?

List windows