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 in‐
40 put instead of the one command specified in the command line argu‐
41 ments. 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 op‐
53 tion, 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 op‐
177 tion 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. (Re‐
196 fer option -w.) The option -r overrides this time limit and wait
197 for at least one message back. After the initial message, it will
198 wait for another message for the time limit. This option is useful
199 when the system is too loaded to make any prediction when the sys‐
200 tem is responding AND the command causes some message to be sent
201 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 pe‐
227 riod unless option -m is used. The default is 500 ms. This option
228 overrides this default value.
229
230
232 If the following error message show up, it is most likely that FvwmCom‐
233 mandS is not running.
234 FvwmCommand error in opening message fifo
235 --No such file or directory--
236 Fvwm modules don't return error messages to fvwm but output on stderr.
237 These error messages will not be shown as FvwmCommand messages.
238
239 FvwmCommand is an interface to send commands to and receive information
240 from Fvwm2 from processes which are not Fvwm modules.
241
242
243
245 test1.pl - takes 1 argument 't' to invoke FvwmTalk
246 'td' to kill FvwmTalk
247 '' to move windows
248 test2.sh - takes 1 argument 'b' to invoke FvwmButtons
249 'kb' to kill FvwmButtons
250 'r' to change # of button rows
251 'c' to change # of button columns
252 ex-auto.pl - auto raise small windows. It will keep them visible.
253 ex-cascade.pl - cascade windows, then move them back.
254 ex-grpmv.pl - choose a group of windows to move together.
255
256 Above examples are not meant to be practical but to show how it can
257 be done.
258
259
260
261 focus-link.pl
262 This is a user programmable window focus script.
263 Default behavior is:
264 1. When a window is opened up, focus the window and move the
265 pointer
266 to it. The parent window regains focus when a window is
267 closed.
268 Parenthood is determined when a window is opened. It is the
269 last
270 focused window with the same X class.
271 2. #1 would not occur to AcroRead opening window.
272 3. #1 would not occur when SkipMapping is set and the window is
273 the
274 only window of its class.
275 4. For Netscape find dialog window, addition to #1, resize the
276 window
277 to 300x150 pixels and move it to East edge of the screen.
278 Download/upload windows will not be focused nor be in focus
279 link
280 list.
281 5. Move appletviewer to NorthWest corner.
282 6. Xterm won't focus back to its parent after closed.
283 7. When a window is de-iconified, focus it and move the pointer.
284
285 focus-Netscape.pl
286 Focuses pop-up windows, such as 'open URL' or 'find' whenever
287 opened up. This let the user to type in immediately without
288 moving mouse. This script also moves 'download' window to the
289 right edge to keep it visible. If this is invoked from
290 .fvwm2rc, use as:
291
292 AddToFunc "StartFunction" "I" Module FvwmCommandS
293 + "I" Exec $HOME/scripts/focus-Netscape.pl
294
295 push-away.pl <direction> <window name>
296 Pushes windows away to avoid overlapping. use as:
297
298 push-away.pl up 'Fvwm Pager'
299
300
301
302
303
304
305
307 fvwm
308
309
311 FvwmCommand is the original work of Toshi Isogai.
312
313
314
315
316
3173rd Berkeley Distribution 19 October 2022 (2.7.0) FvwmCommand(1)