-
Notifications
You must be signed in to change notification settings - Fork 9
/
wmctrl.1
370 lines (318 loc) · 9.37 KB
/
wmctrl.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
.\" Hey, EMACS: -*- nroff -*-
.TH WMCTRL 1 "December 12, 2004"
.SH NAME
wmctrl \- interact with a EWMH/NetWM compatible X Window Manager.
.SH SYNOPSIS
.B wmctrl
.RI [ " options " | " actions " ] ...
.SH DESCRIPTION
.B wmctrl
is a command that can be used to interact with an X Window manager
that is compatible with the EWMH/NetWM specification.
.B wmctrl
can query the window manager for information, and it can request
that certain window management actions be taken.
.PP
.B wmctrl
is controlled entirely by its command line arguments. The command line
arguments are used to specify the action to be performed (with options
that modify behavior) and any arguments that might be needed to
perform the actions.
.PP
The following sections define the supported actions and
options. Arguments to the actions and options are written in the form
.I <ARGNAME>
in the descriptions below. The detailed syntax for writing arguments
are in a single section dedicated to that purpose.
.SH ACTIONS
The following command line arguments can be specified to invoke a
.B wmctrl
action. Only one action can be executed with the invocation of the
.B wmctrl
command.
.TP
.BI \-a " <WIN>"
Switch to the desktop containing the window
.IR <WIN> ,
raise the window, and give it focus.
.TP
.BI "\-b ( add | remove | toggle)," prop1 " [," prop2 " ]"
Add, remove, or toggle up to two window properties simultaneously. The
window that is being modified must be identified with a
.B \-r
action. The
property change is achived by using the EWMH _NET_WM_STATE
request. The supported property names (for
.IR prop1 " and " prop2 )
are
.nh
.BR modal ", " sticky ", " maximized_vert ", " maximized_horz ,
.BR shaded ", " skip_taskbar ", " skip_pager ", " hidden ,
.BR fullscreen ", " above " and " below .
.ny
Two properties are supported to allow operations like maximizing a
window to full screen mode. Note that this action is made up of
exactly two shell command line arguments.
.TP
.BI \-c " <WIN>"
Close the window
.I <WIN>
gracefully.
.TP
.BI \-Y " <WIN>"
Iconify the window
.I <WIN>
\[char46]
.TP
.B \-d
List all desktops managed by the window manager. One line is output
for each desktop, with the line broken up into space separated
columns. The first column contains an integer desktop number. The
second column contains a '*' character for the current desktop,
otherwise it contains a '\-' character. The next two columns contain the
fixed string
.B "DG:"
and then the desktop geometry as
.RI ' <width> "x" <height> '
(\fIe.g.\fR '1280x1024'). The following two columns contain the fixed
string
.B "VP:"
and then the viewport position in the format
.RI ' <y> , <y> '
(\fIe.g.\fR '0,0'). The next three columns after this contains the
fixed string
.B "WA:"
and then two columns with the workarea geometry as
.RI ' X , Y " and " W x H '
(\fIe.g.\fR '0,0 1280x998'). The rest of the line contains the name of
the desktop (possibly containing multiple spaces).
.TP
.BI \-e " <MVARG>"
Resize and move a window that has been specified with a
.B \-r
action according to the
.I <MVARG>
argument.
.TP
.BI \-g " w" , h
Change the geometry (common size) of all desktops so they are
.IR w " pixels wide and " h " pixels high. " w " and " h
must be positive integers. A window manager may ignore this request.
.TP
.B \-h
Print help text about program usage.
.TP
.BI \-I " name"
Set the icon name (short title) of the window specified by a
.B \-r
action to
.IR name .
.TP
.B \-k " (" on " | " off " )"
Turn on or off the window manager's "show the desktop" mode (if the
window manager implements this feature).
.TP
.B \-l
List the windows being managed by the window manager. One line is
output for each window, with the line broken up into space separated
columns. The first column always contains the window identity as a
hexadecimal integer, and the second column always contains the desktop
number (a \-1 is used to identify a sticky window). If the
.B \-p
option is specified the next column will contain the PID for the
window as a decimal integer. If the
.B \-G
option is specified then four integer columns will follow: x-offset,
y-offset, width and height. The next column always contains the client
machine name. The remainder of the line contains the window title
(possibly with multiple spaces in the title).
.TP
.B \-m
Display information about the window manager and the environment.
.TP
.BI \-n " N"
Change the number of desktops to
.IR N
(a non-negative integer).
.TP
.BI \-N " name"
Set the name (long title) of the window specified by a
.B \-r
action to
.IR name .
.TP
.BI \-o " x" , y
Change the viewport for the current desktop. The values
.IR x " and " y
are numeric offsets that specify the position of the top left corner
of the viewport. A window manager may ignore this request.
.TP
.BI \-r " <WIN>"
Specify a target window for an action.
.TP
.BI \-R " <WIN>"
Move the window
.I <WIN>
to the current desktop, raise the window, and give it focus.
.TP
.BI \-s " <DESK>"
Switch to the desktop
.IR <DESK> .
.TP
.BI \-t " <DESK>"
Move a window that has been specified with the
.B \-r
action to the desktop \fI<DESK>\fR.
.TP
.BI \-T " name"
Set the both the name (long title) and icon name (short title) of the
window specified by a
.B \-r
action to
.IR name .
This action is like using the
.BR \-N " and " \-I
actions at the same time (which would otherwise be impossible since
.B wmctrl
can execute only one action at a time).
.SH OPTIONS
The following options modify the default actions, or they modify the
interpretation of arguments.
.TP
.B \-F
Window name arguments
.RI ( <WIN> )
are to be treated as exact window titles that are case
sensitive. Without this options window titles are considered to be
case insensitive substrings of the full window title.
.TP
.B \-G
Include geometry information in the output of the
.B \-l
action.
.TP
.B \-S
List windows in stacking order (bottom to top).
.TP
.B \-i
Interpret window arguments
.RI ( <WIN> )
as a numeric value rather than a
string name for the window. If the numeric value starts with the
prefix '0x' it is assumed to be a hexadecimal number.
.TP
.B \-p
Include PIDs in the window list printed by the
.B \-l
action. Prints a PID of '0' if the application owning the window does
not support it.
.TP
.B \-u
Override auto-detection and force UTF-8 mode.
.TP
.B \-v
Provide verbose output. This is really useful when debugging
.B wmctrl
itself.
.TP
.BI \-w " [ <WORKAROUND>[,<WORKAROUND>]... ]"
Use workarounds specified in the argument.
.TP
.B \-x
Include WM_CLASS in the window list or interpret <WIN> as the WM_CLASS name.
.SH ARGUMENTS
.TP
.I <DESK>
A Desktop is always specified by an integer which represents the
desktop numbers. Desktop numbers start at 0.
.TP
.I <MVARG>
A move and resize argument has the format
.BI ' g , x , y, w , h '.
All five components are integers. The first value,
.IR g ,
is the gravity of the window, with 0 being the most common value (the
default value for the window). Please see the EWMH specification for
other values.
.IP
The four remaining values are a standard geometry specification:
.IB x , y
is the position of the top left corner of the window, and
.IB w , h
is the width and height of the window, with the exception that the
value of \-1 in any position is interpreted to mean that the current
geometry value should not be modified.
.TP
.I <WIN>
This argument specifies a window that is the target of an action. By
default the argument is treated as if were a string, and windows are
examined until one is found with a title the contains the specified
string as a substring. The substring matching is done in a case
insensitive manner. The
.B \-F
option may be used to force exact, case sensitive title matching. The
option
.B \-i
may be used to interpret the window target as a numeric window
identity instead of a string.
.IP
The window name string
.B :SELECT:
is treated specially. If this window name is used then
.B wmctrl
waits for the user to select the target window by clicking on it.
.IP
The window name string
.B :ACTIVE:
may be used to instruct
.B wmctrl
to use the currently active window for the action.
.TP
.I <WORKAROUND>
There is only one work around currently implemeted. It is specified by
using the string
.B DESKTOP_TITLES_INVALID_UTF8
and it causes the printing of non-ASCII desktop tiles correctly when
using Window Maker.
.SH EXAMPLES
.PP
Getting a list of windows managed by the window manager
.IP
wmctrl -l
.PP
Getting a list of windows with PID and geometry information.
.IP
wmctrl -p -G -l
.PP
Going to the window with a name containing 'emacs' in it
.IP
wmctrl -a emacs
.PP
Shade a window with a title that contains the word 'mozilla'
.IP
wmctrl -r mozilla -b add,shaded
.PP
Close a very specifically titled window sticky
.IP
wmctrl -F -c 'Debian bug tracking system - Mozilla'
.PP
Toggle the 'stickiness' of a window with a specific window identity
.IP
wmctrl -i -r 0x0120002 -b add,sticky
.PP
Change the title of window to a specified string but choose the window
by clicking on it
.IP
wmctrl -r :SELECT: -T "Selected Window"
.SH SEE ALSO
.BR zenity (1)
is a useful dialog program for building scripts with
.BR wmctrl .
.PP
Some examples of EWMH/NetWM compatible window managers include recent
versions of Enlightenment, Icewm, Kwin, Sawfish and Xfce.
.SH AUTHOR
wmctrl was written by Tomas Styblo <[email protected]>.
.PP
This manual page was written by Shyamal Prasad <[email protected]>
for the Debian project (but may be used by others).