2 .\" @(#)@PACKAGE@-@VERSION@ @RELDATELONG@
17 .TH FvwmCommand 1 "@RELDATELONG@ (@VERSION@)" Fvwm "Fvwm Modules"
20 FvwmCommand \- fvwm command external interface
23 FvwmCommand [-cmrvw] [-S name] [-i level] [-f name] [-F level] [command...]
27 FvwmCommand lets you monitor fvwm transaction and issue fvwm command
28 from a shell command line or scripts.
29 FvwmCommand takes each argument as a fvwm command. Quotes can be
30 used to send commands including spaces.
32 FvwmCommand 'FvwmPager 0 1'
36 FvwmCommandS should be spawned once by fvwm, either in .fvwm2rc file,
37 from menu, or from FvwmConsole.
38 From then on, FvwmCommand
39 can be called from a shell or script to execute fvwm commands.
41 From within .fvwm2rc file:
47 AddToFunc StartFunction "I" Module FvwmCommandS
50 Then, in script file or from shell:
53 FvwmCommand 'popup Utilities'
58 Informs FvwmCommand to read multiple commands from the standard input
59 instead of the one command specified in the command line arguments.
60 This disables \fI-m\fR or \fI-i\fR.
63 (echo "Exec xload"; echo "Beep") | FvwmCommand -c
66 .IP "\fI-F <level>\fR" 0.4i
67 Specifies the level of fvwm window flags FvwmCommand outputs.
71 No window flags will be printed.
75 Full window flags will be printed if information level, -i
80 .IP "\fI-f <name>\fR" 0.4i
81 Specifies an alternative FIFO set to communicate with a server.
82 The default FIFO set is /var/tmp/FvwmCommand-${DISPLAY}C, in which
83 FvwmCommand..C is used to send commands and FvwmCommand..M is to receive
84 messages. If that path is unusable ${FVWM_USERDIR}/FvwmCommand-${DISPLAY}
86 FvwmCommandS must have been invoked with the same <name> as its first argument
87 prior to FvwmCommand invocation.
88 Alternatively, option -S can be used. Refer option -S.
89 This option -f is useful when a dedicated connection is necessary
90 to run a background job while another connection is kept for
93 .IP "\fI-i <level>\fR"
94 Specifies the level of information that FvwmCommand outputs.
100 FvwmCommand -i0 FvwmBanner
102 will show a banner without any output. On the other hand,
104 FvwmCommand -i 0 foobar
108 [fvwm][executeModule]: <<ERROR>> No such module
109 \'foobar\' in ModulePath '/usr/lib/X11/fvwm'
112 Note that Fvwm doesn't return any error messages in
113 cases like below since 'windowid' itself is a valid command.
116 FvwmCommand -i 0 'windowid foo bar'
119 Errors, replies and window configuration information. This is the default.
121 FvwmCommand send_windowlist
123 Information like below will show up.
126 0x02000014 window FvwmConsole
127 0x02000014 icon FvwmConsole
128 0x02000014 class XTerm
129 0x02000014 resource FvwmConsole
130 0x01c00014 window console
131 0x01c00014 icon console
132 0x01c00014 class XTerm
133 0x01c00014 resource console
134 0x01000003 window Fvwm Pager
136 0x01000003 class FvwmModule
137 0x01000003 resource FvwmPager
138 0x00c0002c window emacs: FvwmCommand.man
139 0x00c0002c icon FvwmCommand.man
140 0x00c0002c icon file xemacs.xpm
141 0x00c0002c class Emacs
142 0x00c0002c resource emacs
145 The first column shows the window ID number, which can be used in 'windowid' command.
146 The second column shows the information types.
147 The last column shows the information contents.
148 If no information is returned, add -w <time> or -r option.
149 This might be needed in heavily loaded systems.
151 Above and static window information.
153 FvwmCommand -i2 'FvwmPager 0 1'
155 The below is its output.
158 0x03c00003 frame x 962, y 743, width 187, height 114
160 0x03c00003 StartIconic no
162 0x03c00003 Sticky yes
163 0x03c00003 WindowListSkip yes
164 0x03c00003 SuppressIcon no
165 0x03c00003 NoiconTitle no
166 0x03c00003 Lenience no
167 0x03c00003 StickyIcon no
168 0x03c00003 CirculateSkipIcon no
169 0x03c00003 CirculateSkip no
170 0x03c00003 ClickToFocus no
171 0x03c00003 SloppyFocus no
172 0x03c00003 SkipMapping no
173 0x03c00003 Handles no
176 0x03c00003 Iconified no
177 0x03c00003 Transient no
179 0x03c00003 Visible no
180 0x03c00003 IconOurs no
181 0x03c00003 PixmapOurs no
182 0x03c00003 ShapedIcon no
183 0x03c00003 Maximized no
184 0x03c00003 WmTakeFocus no
185 0x03c00003 WmDeleteWindow yes
186 0x03c00003 IconMoved no
187 0x03c00003 IconUnmapped no
188 0x03c00003 MapPending no
189 0x03c00003 HintOverride yes
190 0x03c00003 MWMButtons no
191 0x03c00003 MWMBorders no
192 0x03c00003 title height 0
193 0x03c00003 border width 4
194 0x03c00003 base size width 8, height 7
195 0x03c00003 size increment width 9, height 9
196 0x03c00003 min size width 8, height 7
197 0x03c00003 max size width 32767, height 32767
198 0x03c00003 gravity SouthEast
199 0x03c00003 pixel text 0xffffff, back 0x7f7f7f
200 0x03c00003 window Fvwm Pager
201 0x03c00003 icon Fvwm Pager
202 0x03c00003 class FvwmModule
203 0x03c00003 resource FvwmPager
206 All information available.
208 FvwmCommand -i3 'Killmodule Fvwm*'
210 This will report which windows are closed.
218 Monitors fvwm window information transaction. FvwmCommand continuously outputs
219 information that it receives without exiting.
220 This option can be used in a
221 background job often combined with -i3 option in order to control windows
224 FvwmCommand -mi3 | grep 'iconify'
226 It will report when windows are iconified or de-iconified.
228 Note: FvwmCommand does not block buffer its output but many utilities such as
229 grep or sed use block buffer. The output of the next example will not show up
230 until either FvwmCommand is terminated or stdout buffer from
233 FvwmCommand -mi3 | grep ' map' |
234 sed 's/\\(0x[0-9a-f]*\\).*/windowid \\1 move 0 0/'
236 Instead, use tools with buffer control such as pty or perl.
237 The below will iconify new windows when opened.
239 Fvwm -mi3 | perl -ne '
241 print "windowid $1 iconify\\n" if /^(0x\\S+) add/;
242 \' > ~/\.FvwmCommandC
245 Waits for a reply before it exits.
246 FvwmCommand exits if no information or error is returned in a fixed amount of
247 time period. (Refer option -w.)
248 The option -r overrides this time limit and wait for at least one message
250 After the initial message, it will wait for another message for the time
252 This option is useful when the system is too loaded to make any prediction
253 when the system is responding AND the command causes some
254 message to be sent back.
256 .IP "\fI-S <name>\fR" 0.4i
257 Invokes another server, FvwmCommandS, with FIFO set <name>.
259 If -f option is not used with this option,
260 the invoking FvwmCommand uses the default FIFO to communicate
261 the default server to invoke a new server.
263 If -f option is used with this option,
264 the invoking FvwmCommand uses the default FIFO to communicate
265 the default server to invoke a new server. Then, switch the FIFO
266 set and start communicating the new server.
268 This option -S is useful when a dedicated connection is necessary
270 job while another connection is kept for interactive use.
272 If the <name> is a relative path name, that is relative from where
273 fvwm is running, not from where FvwmCommand is invoked.
276 Returns FvwmCommand version number and exits.
278 .IP "\fI-w <time>\fR"
279 Waits for <time> micro seconds for a message.
280 FvwmCommand exits if no information or error is returned in a fixed amount of
281 time period unless option -m is used.
282 The default is 500 ms. This option overrides this default value.
287 FvwmCommand.sh has bourne shell function definitions
288 to keep the syntax similar to fvwm configuration file.
289 This file is to be sourced:
296 FvwmCommand.pm is for perl in order
297 to keep the syntax similar to fvwm configuration file.
298 Commas can be used to separate fvwm commands' arguments.
301 if( $ARGV[0] eq 'home' ) {
302 Desk 0,0; GotoPage '1 1';
303 }elsif( $ARGV[0] eq 'jump' ) {
304 Desk "0 2"; GotoPage 0, 1;
307 Although arguments in FvwmCommand are not case sensitive as fvwm,
308 the functions defined in FvwmCommand.sh and FvwmCommand.pl are case sensitive.
312 If the following error message show up, it is most likely that FvwmCommandS
315 FvwmCommand error in opening message fifo
316 --No such file or directory--
318 Fvwm modules don't return error messages to fvwm but output on
319 stderr. These error messages will not be shown as FvwmCommand messages.
321 FvwmCommand is an interface to send commands to and receive
322 information from Fvwm2 from processes which are not Fvwm modules.
326 test1.pl - takes 1 argument 't' to invoke FvwmTalk
327 'td' to kill FvwmTalk
329 test2.sh - takes 1 argument 'b' to invoke FvwmButtons
330 'kb' to kill FvwmButtons
331 'r' to change # of button rows
332 'c' to change # of button columns
333 ex-auto.pl - auto raise small windows. It will keep them visible.
334 ex-cascade.pl - cascade windows, then move them back.
335 ex-grpmv.pl - choose a group of windows to move together.
337 Above examples are not meant to be practical but to show how it can
343 This is a user programmable window focus script.
345 1. When a window is opened up, focus the window and move the pointer
346 to it. The parent window regains focus when a window is closed.
347 Parenthood is determined when a window is opened. It is the last
348 focused window with the same X class.
349 2. #1 would not occur to AcroRead opening window.
350 3. #1 would not occur when SkipMapping is set and the window is the
351 only window of its class.
352 4. For Netscape find dialog window, addition to #1, resize the window
353 to 300x150 pixels and move it to East edge of the screen.
354 Download/upload windows will not be focused nor be in focus link
356 5. Move appletviewer to NorthWest corner.
357 6. Xterm won't focus back to its parent after closed.
358 7. When a window is de-iconified, focus it and move the pointer.
361 Focuses pop-up windows, such as 'open URL' or 'find' whenever
362 opened up. This let the user to type in immediately without
363 moving mouse. This script also moves 'download' window to the
364 right edge to keep it visible. If this is invoked from
367 AddToFunc "StartFunction" "I" Module FvwmCommandS
368 + "I" Exec $HOME/scripts/focus-Netscape.pl
370 push-away.pl <direction> <window name>
371 Pushes windows away to avoid overlapping. use as:
373 push-away.pl up 'Fvwm Pager'
384 FvwmCommand is the original work of Toshi Isogai.