1FvwmCommand(1) Fvwm Modules FvwmCommand(1)
2
3
4
6 FvwmCommand - fvwm command external interface
7
8
10 FvwmCommand [-cmrvw] [-S name] [-i level] [-f name] [-F level] [com‐
11 mand...]
12
13
15 FvwmCommand lets you monitor fvwm transaction and issue fvwm command
16 from a shell command line or scripts. FvwmCommand takes each argument
17 as a fvwm command. Quotes can be used to send commands including spa‐
18 ces.
19 FvwmCommand 'FvwmPager 0 1'
20
22 FvwmCommandS should be spawned once by fvwm, either in .fvwm2rc file,
23 from menu, or from FvwmConsole. From then on, FvwmCommand can be
24 called from a shell or script to execute fvwm commands.
25
26 From within .fvwm2rc file:
27 Module FvwmCommandS
28
29 or
30
31 AddToFunc StartFunction "I" Module FvwmCommandS
32
33 Then, in script file or from shell:
34
35 FvwmCommand 'popup Utilities'
36
37
39 -c Informs FvwmCommand to read multiple commands from the standard
40 input instead of the one command specified in the command line
41 arguments. This disables -m or -i.
42
43 (echo "Exec xload"; echo "Beep") | FvwmCommand -c
44
45
46 -F <level>
47 Specifies the level of fvwm window flags FvwmCommand outputs.
48
49
50 0 No window flags will be printed.
51
52 2 Full window flags will be printed if information level, -i
53 option, is 2 or 3.
54
55
56
57 -f <name>
58 Specifies an alternative FIFO set to communicate with a server.
59 The default FIFO set is /var/tmp/FvwmCommand-${DISPLAY}C, in which
60 FvwmCommand..C is used to send commands and FvwmCommand..M is to
61 receive messages. If that path is unusable ${FVWM_USERDIR}/FvwmCom‐
62 mand-${DISPLAY} will be used instead. FvwmCommandS must have been
63 invoked with the same <name> as its first argument prior to Fvwm‐
64 Command invocation. Alternatively, option -S can be used. Refer
65 option -S. This option -f is useful when a dedicated connection is
66 necessary to run a background job while another connection is kept
67 for interactive use.
68
69
70 -i <level>
71 Specifies the level of information that FvwmCommand outputs.
72
73
74 0 Error messages only.
75 FvwmCommand -i0 FvwmBanner
76 will show a banner without any output. On the other hand,
77 FvwmCommand -i 0 foobar
78 will return,
79 [fvwm][executeModule]: <<ERROR>> No such module
80 ´foobar´ in ModulePath '/usr/lib/X11/fvwm'
81
82 Note that Fvwm doesn't return any error messages in cases like
83 below since 'windowid' itself is a valid command.
84
85 FvwmCommand -i 0 'windowid foo bar'
86
87 1 Errors, replies and window configuration information. This is
88 the default.
89 FvwmCommand send_windowlist
90 Information like below will show up.
91
92 0x02000014 window FvwmConsole
93 0x02000014 icon FvwmConsole
94 0x02000014 class XTerm
95 0x02000014 resource FvwmConsole
96 0x01c00014 window console
97 0x01c00014 icon console
98 0x01c00014 class XTerm
99 0x01c00014 resource console
100 0x01000003 window Fvwm Pager
101 0x01000003 icon
102 0x01000003 class FvwmModule
103 0x01000003 resource FvwmPager
104 0x00c0002c window emacs: FvwmCommand.man
105 0x00c0002c icon FvwmCommand.man
106 0x00c0002c icon file xemacs.xpm
107 0x00c0002c class Emacs
108 0x00c0002c resource emacs
109 end windowlist
110 The first column shows the window ID number, which can be used
111 in 'windowid' command. The second column shows the information
112 types. The last column shows the information contents. If no
113 information is returned, add -w <time> or -r option. This
114 might be needed in heavily loaded systems.
115
116 2 Above and static window information.
117 FvwmCommand -i2 'FvwmPager 0 1'
118 The below is its output.
119
120 0x03c00003 frame x 962, y 743, width 187, height 114
121 0x03c00003 desktop 0
122 0x03c00003 StartIconic no
123 0x03c00003 OnTop yes
124 0x03c00003 Sticky yes
125 0x03c00003 WindowListSkip yes
126 0x03c00003 SuppressIcon no
127 0x03c00003 NoiconTitle no
128 0x03c00003 Lenience no
129 0x03c00003 StickyIcon no
130 0x03c00003 CirculateSkipIcon no
131 0x03c00003 CirculateSkip no
132 0x03c00003 ClickToFocus no
133 0x03c00003 SloppyFocus no
134 0x03c00003 SkipMapping no
135 0x03c00003 Handles no
136 0x03c00003 Title no
137 0x03c00003 Mapped no
138 0x03c00003 Iconified no
139 0x03c00003 Transient no
140 0x03c00003 Raised no
141 0x03c00003 Visible no
142 0x03c00003 IconOurs no
143 0x03c00003 PixmapOurs no
144 0x03c00003 ShapedIcon no
145 0x03c00003 Maximized no
146 0x03c00003 WmTakeFocus no
147 0x03c00003 WmDeleteWindow yes
148 0x03c00003 IconMoved no
149 0x03c00003 IconUnmapped no
150 0x03c00003 MapPending no
151 0x03c00003 HintOverride yes
152 0x03c00003 MWMButtons no
153 0x03c00003 MWMBorders no
154 0x03c00003 title height 0
155 0x03c00003 border width 4
156 0x03c00003 base size width 8, height 7
157 0x03c00003 size increment width 9, height 9
158 0x03c00003 min size width 8, height 7
159 0x03c00003 max size width 32767, height 32767
160 0x03c00003 gravity SouthEast
161 0x03c00003 pixel text 0xffffff, back 0x7f7f7f
162 0x03c00003 window Fvwm Pager
163 0x03c00003 icon Fvwm Pager
164 0x03c00003 class FvwmModule
165 0x03c00003 resource FvwmPager
166
167 3 All information available.
168 FvwmCommand -i3 'Killmodule Fvwm*'
169 This will report which windows are closed.
170 0x03400003 destroy
171 0x02400002 destroy
172
173
174 -m Monitors fvwm window information transaction. FvwmCommand continu‐
175 ously outputs information that it receives without exiting. This
176 option can be used in a background job often combined with -i3
177 option in order to control windows dynamically.
178 FvwmCommand -mi3 | grep 'iconify'
179 It will report when windows are iconified or de-iconified.
180
181 Note: FvwmCommand does not block buffer its output but many utili‐
182 ties such as grep or sed use block buffer. The output of the next
183 example will not show up until either FvwmCommand is terminated or
184 stdout buffer from grep is filled.
185 FvwmCommand -mi3 | grep ' map' |
186 sed 's/\(0x[0-9a-f]*\).*/windowid \1 move 0 0/'
187 Instead, use tools with buffer control such as pty or perl. The
188 below will iconify new windows when opened.
189 Fvwm -mi3 | perl -ne '
190 $|=1;
191 print "windowid $1 iconify\n" if /^(0x\S+) add/;
192 ´ > ~/.FvwmCommandC
193
194 -r Waits for a reply before it exits. FvwmCommand exits if no infor‐
195 mation or error is returned in a fixed amount of time period.
196 (Refer option -w.) The option -r overrides this time limit and
197 wait for at least one message back. After the initial message, it
198 will wait for another message for the time limit. This option is
199 useful when the system is too loaded to make any prediction when
200 the system is responding AND the command causes some message to be
201 sent back.
202
203
204 -S <name>
205 Invokes another server, FvwmCommandS, with FIFO set <name>.
206 If -f option is not used with this option, the invoking FvwmCommand
207 uses the default FIFO to communicate the default server to invoke a
208 new server.
209 If -f option is used with this option, the invoking FvwmCommand
210 uses the default FIFO to communicate the default server to invoke a
211 new server. Then, switch the FIFO set and start communicating the
212 new server.
213 This option -S is useful when a dedicated connection is necessary
214 to run a background job while another connection is kept for inter‐
215 active use.
216
217 If the <name> is a relative path name, that is relative from where
218 fvwm is running, not from where FvwmCommand is invoked.
219
220
221 -v Returns FvwmCommand version number and exits.
222
223
224 -w <time>
225 Waits for <time> micro seconds for a message. FvwmCommand exits if
226 no information or error is returned in a fixed amount of time
227 period unless option -m is used. The default is 500 ms. This
228 option overrides this default value.
229
230
232 FvwmCommand.sh has bourne shell function definitions to keep the syntax
233 similar to fvwm configuration file. This file is to be sourced:
234 . FvwmCommand.sh
235 DesktopSize 5x5
236 FvwmCommand.pm is for perl in order to keep the syntax similar to fvwm
237 configuration file. Commas can be used to separate fvwm commands'
238 arguments.
239 use FvwmCommand;
240 if( $ARGV[0] eq 'home' ) {
241 Desk 0,0; GotoPage '1 1';
242 }elsif( $ARGV[0] eq 'jump' ) {
243 Desk "0 2"; GotoPage 0, 1;
244 }
245 Although arguments in FvwmCommand are not case sensitive as fvwm, the
246 functions defined in FvwmCommand.sh and FvwmCommand.pl are case sensi‐
247 tive.
248
249
250
252 If the following error message show up, it is most likely that FvwmCom‐
253 mandS is not running.
254 FvwmCommand error in opening message fifo
255 --No such file or directory--
256 Fvwm modules don't return error messages to fvwm but output on stderr.
257 These error messages will not be shown as FvwmCommand messages.
258
259 FvwmCommand is an interface to send commands to and receive information
260 from Fvwm2 from processes which are not Fvwm modules.
261
262
263
265 test1.pl - takes 1 argument 't' to invoke FvwmTalk
266 'td' to kill FvwmTalk
267 '' to move windows
268 test2.sh - takes 1 argument 'b' to invoke FvwmButtons
269 'kb' to kill FvwmButtons
270 'r' to change # of button rows
271 'c' to change # of button columns
272 ex-auto.pl - auto raise small windows. It will keep them visible.
273 ex-cascade.pl - cascade windows, then move them back.
274 ex-grpmv.pl - choose a group of windows to move together.
275
276 Above examples are not meant to be practical but to show how it can
277 be done.
278
279
280
281 focus-link.pl
282 This is a user programmable window focus script.
283 Default behavior is:
284 1. When a window is opened up, focus the window and move the
285 pointer
286 to it. The parent window regains focus when a window is
287 closed.
288 Parenthood is determined when a window is opened. It is the
289 last
290 focused window with the same X class.
291 2. #1 would not occur to AcroRead opening window.
292 3. #1 would not occur when SkipMapping is set and the window is
293 the
294 only window of its class.
295 4. For Netscape find dialog window, addition to #1, resize the
296 window
297 to 300x150 pixels and move it to East edge of the screen.
298 Download/upload windows will not be focused nor be in focus
299 link
300 list.
301 5. Move appletviewer to NorthWest corner.
302 6. Xterm won't focus back to its parent after closed.
303 7. When a window is de-iconified, focus it and move the pointer.
304
305 focus-Netscape.pl
306 Focuses pop-up windows, such as 'open URL' or 'find' whenever
307 opened up. This let the user to type in immediately without
308 moving mouse. This script also moves 'download' window to the
309 right edge to keep it visible. If this is invoked from
310 .fvwm2rc, use as:
311
312 AddToFunc "StartFunction" "I" Module FvwmCommandS
313 + "I" Exec $HOME/scripts/focus-Netscape.pl
314
315 push-away.pl <direction> <window name>
316 Pushes windows away to avoid overlapping. use as:
317
318 push-away.pl up 'Fvwm Pager'
319
320
321
322
323
324
325
327 fvwm
328
329
331 FvwmCommand is the original work of Toshi Isogai.
332
333
334
335
336
3373rd Berkeley Distribution 06 November 2016 (2.6.7) FvwmCommand(1)