File: FvwmCommand.1.in

package info (click to toggle)
fvwm 1:2.6.7-3
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 16,752 kB
  • ctags: 14,275
  • sloc: ansic: 145,770; xml: 17,086; perl: 7,302; sh: 4,885; makefile: 1,055; yacc: 688; python: 629; lex: 188; sed: 11
file content (386 lines) | stat: -rw-r--r-- 11,807 bytes parent folder | download | duplicates (6)
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
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
.\" t
.\" @(#)@PACKAGE@-@VERSION@ @RELDATELONG@
.de EX		\"Begin example
.ne 5
.if n .sp 1
.if t .sp .5
.nf
.in +.25i
..
.de EE
.fi
.in -.25i
.if n .sp 1
.if t .sp .5
..
.ta .2i .4i .6i .8i
.TH FvwmCommand 1 "@RELDATELONG@ (@VERSION@)" Fvwm "Fvwm Modules"
.UC
.SH NAME
FvwmCommand \- fvwm command external interface

.SH SYNOPSIS
FvwmCommand [-cmrvw] [-S name] [-i level] [-f name] [-F level] [command...]

.SH DESCRIPTION

FvwmCommand lets you monitor fvwm transaction and issue fvwm command
from a shell command line or scripts.
FvwmCommand takes each argument as a fvwm command. Quotes can be
used to send commands including spaces.
.EX
FvwmCommand 'FvwmPager 0 1'
.EE
.br
.SH INVOCATION
FvwmCommandS should be spawned once by fvwm, either in .fvwm2rc file,
from menu, or from FvwmConsole.
From then on, FvwmCommand
can be called from a shell or script to execute fvwm commands.

From within .fvwm2rc file:
.EX
Module FvwmCommandS

    or

AddToFunc StartFunction "I" Module FvwmCommandS
.EE

Then, in script file or from shell:

.EX
FvwmCommand  'popup Utilities'
.EE

.SH OPTIONS
.IP "\fI-c\fR" 0.4i
Informs FvwmCommand to read multiple commands from the standard input
instead of the one command specified in the command line arguments.
This disables \fI-m\fR or \fI-i\fR.
.sp
.EX
(echo "Exec xload"; echo "Beep") | FvwmCommand -c
.EE

.IP "\fI-F <level>\fR" 0.4i
Specifies the level of fvwm window flags FvwmCommand outputs.
.sp
.RS
.IP 0 0.4i
No window flags will be printed.
.RE
.RS
.IP 2 0.4i
Full window flags will be printed if information level, -i
option, is 2 or 3.
.sp
.RE

.IP "\fI-f <name>\fR" 0.4i
Specifies an alternative FIFO set to communicate with a server.
The default FIFO set is /var/tmp/FvwmCommand-${DISPLAY}C, in which
FvwmCommand..C is used to send commands and FvwmCommand..M is to receive
messages. If that path is unusable ${FVWM_USERDIR}/FvwmCommand-${DISPLAY}
will be used instead.
FvwmCommandS must have been invoked with the same <name> as its first argument
prior to FvwmCommand invocation.
Alternatively, option -S can be used. Refer option -S.
This option -f is useful when a dedicated connection is necessary
to run a background job while another connection is kept for
interactive use.

.IP "\fI-i <level>\fR"
Specifies the level of information that FvwmCommand outputs.
.sp
.RS
.IP 0 0.4i
Error messages only.
.EX
FvwmCommand -i0 FvwmBanner
.EE
will show a banner without any output. On the other hand,
.EX
FvwmCommand -i 0 foobar
.EE
will return,
.EX
[fvwm][executeModule]: <<ERROR>> No such module
\'foobar\' in ModulePath '/usr/lib/X11/fvwm'
.EE

Note that Fvwm doesn't return any error messages in
cases like below since 'windowid' itself is a valid command.
.sp
.EX
FvwmCommand -i 0 'windowid foo bar'
.EE
.IP 1
Errors, replies and window configuration information. This is the default.
.EX
FvwmCommand send_windowlist
.EE
Information like below will show up.
.EX

0x02000014 window               FvwmConsole
0x02000014 icon                 FvwmConsole
0x02000014 class                XTerm
0x02000014 resource             FvwmConsole
0x01c00014 window               console
0x01c00014 icon                 console
0x01c00014 class                XTerm
0x01c00014 resource             console
0x01000003 window               Fvwm Pager
0x01000003 icon
0x01000003 class                FvwmModule
0x01000003 resource             FvwmPager
0x00c0002c window               emacs: FvwmCommand.man
0x00c0002c icon                 FvwmCommand.man
0x00c0002c icon file            xemacs.xpm
0x00c0002c class                Emacs
0x00c0002c resource             emacs
end windowlist
.EE
The first column shows the window ID number, which can be used in 'windowid' command.
The second column shows the information types.
The last column shows the information contents.
If no information is returned, add -w <time> or -r option.
This might be needed in heavily loaded systems.
.IP 2
Above and static window information.
.EX
FvwmCommand -i2 'FvwmPager 0 1'
.EE
The below is its output.
.EX

0x03c00003 frame                x 962, y 743, width 187, height 114
0x03c00003 desktop              0
0x03c00003 StartIconic          no
0x03c00003 OnTop                yes
0x03c00003 Sticky               yes
0x03c00003 WindowListSkip       yes
0x03c00003 SuppressIcon         no
0x03c00003 NoiconTitle          no
0x03c00003 Lenience             no
0x03c00003 StickyIcon           no
0x03c00003 CirculateSkipIcon    no
0x03c00003 CirculateSkip        no
0x03c00003 ClickToFocus         no
0x03c00003 SloppyFocus          no
0x03c00003 SkipMapping          no
0x03c00003 Handles              no
0x03c00003 Title                no
0x03c00003 Mapped               no
0x03c00003 Iconified            no
0x03c00003 Transient            no
0x03c00003 Raised               no
0x03c00003 Visible              no
0x03c00003 IconOurs             no
0x03c00003 PixmapOurs           no
0x03c00003 ShapedIcon           no
0x03c00003 Maximized            no
0x03c00003 WmTakeFocus          no
0x03c00003 WmDeleteWindow       yes
0x03c00003 IconMoved            no
0x03c00003 IconUnmapped         no
0x03c00003 MapPending           no
0x03c00003 HintOverride         yes
0x03c00003 MWMButtons           no
0x03c00003 MWMBorders           no
0x03c00003 title height         0
0x03c00003 border width         4
0x03c00003 base size            width 8, height 7
0x03c00003 size increment       width 9, height 9
0x03c00003 min size             width 8, height 7
0x03c00003 max size             width 32767, height 32767
0x03c00003 gravity              SouthEast
0x03c00003 pixel                text 0xffffff, back 0x7f7f7f
0x03c00003 window               Fvwm Pager
0x03c00003 icon                 Fvwm Pager
0x03c00003 class                FvwmModule
0x03c00003 resource             FvwmPager
.EE
.IP 3
All information available.
.EX
FvwmCommand -i3 'Killmodule Fvwm*'
.EE
This will report which windows are closed.
.EX
0x03400003 destroy
0x02400002 destroy
.EE
.RE

.IP "\fI-m\fR"
Monitors fvwm window information transaction. FvwmCommand continuously outputs
information that it receives without exiting.
This option can be used in a
background job often combined with -i3 option in order to control windows
dynamically.
.EX
FvwmCommand -mi3 | grep 'iconify'
.EE
It will report when windows are iconified or de-iconified.
.sp
Note: FvwmCommand does not block buffer its output but many utilities such as
grep or sed use block buffer. The output of the next example will not show up
until either FvwmCommand is terminated or stdout buffer from
grep is filled.
.EX
FvwmCommand -mi3 | grep ' map' |
sed 's/\\(0x[0-9a-f]*\\).*/windowid \\1 move 0 0/'
.EE
Instead, use tools with buffer control such as pty or perl.
The below will iconify new windows when opened.
.EX
Fvwm -mi3 | perl -ne '
$|=1;
print "windowid $1 iconify\\n" if /^(0x\\S+) add/;
\' > ~/\.FvwmCommandC
.EE
.IP "\fI-r\fR"
Waits for a reply before it exits.
FvwmCommand exits if no information or error is returned in a fixed amount of
time period. (Refer option -w.)
The option -r overrides this time limit and wait for at least one message
back.
After the initial message, it will wait for another message for the time
limit.
This option is useful when the system is too loaded to make any prediction
when the system is responding AND the command causes some
message to be sent back.

.IP "\fI-S <name>\fR" 0.4i
Invokes another server, FvwmCommandS, with FIFO set <name>.
.br
If -f option is not used with this option,
the invoking FvwmCommand uses the default FIFO to communicate
the default server to invoke a new server.
.br
If -f option is used with this option,
the invoking FvwmCommand uses the default FIFO to communicate
the default server to invoke a new server. Then, switch the FIFO
set and start communicating the new server.
.br
This option -S is useful when a dedicated connection is necessary
to run a background
job while another connection is kept for interactive use.

If the <name> is a relative path name, that is relative from where
fvwm is running, not from where FvwmCommand is invoked.

.IP "\fI-v\fR"
Returns FvwmCommand version number and exits.

.IP "\fI-w <time>\fR"
Waits for <time> micro seconds for a message.
FvwmCommand exits if no information or error is returned in a fixed amount of
time period unless option -m is used.
The default is 500 ms. This option overrides this default value.

.SH WRAPPER
.sp
.sp
FvwmCommand.sh has bourne shell function definitions
to keep the syntax similar to fvwm configuration file.
This file is to be sourced:
.EX
\&. FvwmCommand.sh
.br
DesktopSize 5x5
.EE
.br
FvwmCommand.pm is for perl in order
to keep the syntax similar to fvwm configuration file.
Commas can be used to separate fvwm commands' arguments.
.EX
use FvwmCommand;
if( $ARGV[0] eq 'home' ) {
    Desk 0,0; GotoPage '1 1';
}elsif( $ARGV[0] eq 'jump' ) {
    Desk "0 2"; GotoPage 0, 1;
}
.EE
Although arguments in FvwmCommand are not case sensitive as fvwm,
the functions defined in FvwmCommand.sh and FvwmCommand.pl are case sensitive.


.SH ERRORS
If the following error message show up, it is most likely that FvwmCommandS
is not running.
.EX
FvwmCommand error in opening message fifo
--No such file or directory--
.EE
Fvwm modules don't return error messages to fvwm but output on
stderr. These error messages will not be shown as FvwmCommand messages.

FvwmCommand is an interface to send commands to and receive
information from Fvwm2 from processes which are not Fvwm modules.


.SH EXAMPLES
  test1.pl      - takes 1 argument  't' to invoke FvwmTalk
                                    'td'  to kill FvwmTalk
                                    ''  to move windows
  test2.sh      - takes 1 argument  'b'  to invoke FvwmButtons
                                    'kb' to kill FvwmButtons
                                    'r'  to change # of button rows
                                    'c'  to change # of button columns
  ex-auto.pl    - auto raise small windows. It will keep them visible.
  ex-cascade.pl - cascade windows, then move them back.
  ex-grpmv.pl   - choose a group of windows to move together.

  Above examples are not meant to be practical but to show how it can
  be done.



  focus-link.pl
     This is a user programmable window focus script.
     Default behavior is:
      1. When a window is opened up, focus the window and move the pointer
         to it. The parent window regains focus when a window is closed.
         Parenthood is determined when a window is opened. It is the last
         focused window with the same X class.
      2. #1 would not occur to AcroRead opening window.
      3. #1 would not occur when SkipMapping is set and the window is the
         only window of its class.
      4. For Netscape find dialog window, addition to #1, resize the window
         to 300x150 pixels and move it to East edge of the screen.
         Download/upload windows will not be focused nor be in focus link
         list.
      5. Move appletviewer to NorthWest corner.
      6. Xterm won't focus back to its parent after closed.
      7. When a window is de-iconified, focus it and move the pointer.

  focus-Netscape.pl
      Focuses pop-up windows, such as 'open URL' or 'find' whenever
      opened up. This let the user to type in immediately without
      moving mouse. This script also moves 'download' window to the
      right edge to keep it visible. If this is invoked from
      .fvwm2rc, use as:

          AddToFunc "StartFunction" "I" Module  FvwmCommandS
          + "I" Exec $HOME/scripts/focus-Netscape.pl

  push-away.pl <direction> <window name>
      Pushes windows away to avoid overlapping. use as:

          push-away.pl up 'Fvwm Pager'






.SH SEE ALSO
fvwm

.SH AUTHOR
FvwmCommand is the original work of Toshi Isogai.