1= FvwmButtons(1)
2
3:doctype: manpage
4:mantitle: FvwmButtons
5:manname: FvwmButtons
6:manmanual: Fvwm Modules
7:manvolnum: 1
8:page-layout: base
9
10== NAME
11
12FvwmButtons - the fvwm buttonbox module
13
14== SYNOPSIS
15
16....
17Module FvwmButtons [-g geometry] [-transient | -transientpanel] [name[configfile]]
18....
19
20_FvwmButtons_ can only be invoked by fvwm. Command line invocation of
21the _FvwmButtons_ module will not work.
22
23== DESCRIPTION
24
25The FvwmButtons module provides a window of buttons which sits on the X
26terminal's root window. The user can press the buttons at any time, and
27trigger invocation of a user-specified command by the window manager.
28FvwmButtons only works when fvwm is used as the window manager.
29
30The buttonbox can be of any configuration or geometry, and can have
31monochrome or color icons to represent the actions which would be
32invoked. Even other applications can be 'swallowed' by the button bar.
33
34Panels that are opened on a button press are available too. See
35_CREATING PANELS_ section for details.
36
37== OPTIONS
38
39The _-g_ option specifies the geometry of the main window. The command
40line option takes precedence over any other geometry settings in the
41configuration file.
42
43The _-transient_ option tells FvwmButtons to terminate itself after the
44first key or button press has been received (presses to open a sub panel
45do not count) or a sub panel has been closed or respawned. This is
46especially useful for sub panels where you want to select a single
47button and have it closed automatically. It could be used to create
48two-dimensional graphical menus. Since _-transient_ is an option, not a
49configuration setting you can use the same configuration for transient
50and non transient button bars.
51
52The _-transientpanel_ option does roughly the same as the _-transient_
53option, but instead of closing the whole button bar, the window is
54merely hidden. This is very useful if the button bar is started as a
55subpanel of another button bar because it avoids that it must be started
56again when something is selected.
57
58== INVOCATION
59
60FvwmButtons is spawned by fvwm, so command line invocation will not
61work.
62
63FvwmButtons can be invoked by inserting the line 'Module FvwmButtons
64OptionalName' in the .fvwm2rc file. This should be placed in the
65StartFunction if FvwmButtons is to be spawned during fvwm's
66initialization. This can be bound to a menu or mouse button or keystroke
67to invoke it later.
68
69When invoked with the _OptionalName_ argument, the _OptionalName_ is
70used to find configuration commands. For example:
71
72....
73AddToFunc StartFunction Module FvwmButtons MyButtonBox
74....
75
76FvwmButtons will then use only the lines starting with "*MyButtonBox",
77instead of the default "*FvwmButtons".
78
79== CONFIGURATION OPTIONS
80
81The following commands are understood by FvwmButtons:
82
83*FvwmButtons: Back color::
84  Specifies the background color for the buttons. The relief and shadow
85  color are calculated from the background color.
86
87*FvwmButtons: BoxSize algorithm::
88  This option specifies how serious FvwmButtons takes the Rows and
89  Columns options (see below). It can be one of _dumb_, _fixed_ or
90  _smart_.
91+
92
93If _fixed_ is used and both Rows and Columns are specified and non-zero,
94FvwmButtons uses exactly the number of rows and columns specified. If
95the box is too small to accommodate all buttons the module will fail.
96+
97
98If _smart_ is used FvwmButtons enlarges the box so all buttons have a
99chance to fit. The number of columns is increased to at least the width
100of the widest button and new rows are added until all buttons are
101placed. For the best tolerance of configuration errors use the smart
102option.
103
104+
105
106_dumb_ is neither _fixed_ nor _smart._ This is the default.
107
108*FvwmButtons: Colorset colorset::
109  Tells the module to use colorset _colorset_ for the window background.
110  Refer to the fvwm man page for details about colorsets.
111
112*FvwmButtons: ActiveColorset colorset::
113  Tells the module to use colorset _colorset_ for the background
114  color/image and/or title color of a button when the mouse is hovering
115  above a button.
116
117*FvwmButtons: PressColorset colorset::
118  Tells the module to use colorset _colorset_ for the background
119  color/image and/or title color of a button when it is pressed.
120
121*FvwmButtons: Columns columns::
122  Specifies the number of columns of buttons to be created. If
123  unspecified, the number of columns is set to the number of buttons
124  requested, divided by the number of rows. If both the rows and columns
125  are specified, but the number of buttons is more than the rows and
126  columns allow for, the columns specification is ignored unless the
127  _BoxSize_ option is _fixed_.
128
129*FvwmButtons: File filename::
130  Specifies that the configuration for this button is found in the file
131  _filename_. _Filename_ can be a full pathname, or is assumed to be in
132  fvwm's startup directory. The configuration file is in the same format
133  as fvwm's configuration file, but each line is read as if prefixed by
134  "*FvwmButtons". Comments are given by starting a line with "#". Line
135  continuation is done by ending a line with a "\".
136
137*FvwmButtons: Font font::
138  Specifies the font to be used for labeling the buttons, or _None_.
139
140*FvwmButtons: Fore color::
141  Specifies the color used for button label text and monochrome icons.
142
143*FvwmButtons: Frame width::
144  Specifies the width of the relief around each button. If this is a
145  negative number, the relief is inverted. This makes the button sunken
146  normally and raised when activated.
147
148*FvwmButtons: Geometry geometry::
149  Specifies the FvwmButtons window location and size. The geometry is a
150  standard X11 window geometry specification.
151
152*FvwmButtons: ButtonGeometry geometry::
153  This option works like the _Geometry_ option except that the size is
154  the size of a single button. The size of the whole FvwmButtons window
155  is calculated by multiplying the button dimension by the number of
156  rows and columns.
157
158*FvwmButtons: Padding width height::
159  This option specifies the default horizontal padding to be _width_
160  pixels, and the vertical padding to be _height_ pixels. The amount of
161  free space between the relief of the button and its contents is
162  normally 2 pixels on the sides and 4 pixels above and below, except
163  for swallowed windows and containers, which are not padded at all,
164  unless this option is used.
165
166*FvwmButtons: Pixmap pixmapfile::
167  Specifies a background pixmap to use. Specify "none" (without the
168  double quotes) for a transparent background.
169
170*FvwmButtons: Rows rows::
171  Specifies the number of rows of buttons to be created. The default is
172  2 rows.
173
174*FvwmButtons: WindowName name::
175  If FvwmButtons has a titlebar enabled with Title style, (for example,
176  some transient subpanel), this option can set it's Window name and
177  Icon name to a string provided with this parameter. If omitted,
178  default for Window and Icon name is the window resource name which
179  itself is simply "FvwmButtons", or is derived from the alias by which
180  FvwmButtons configuration is referenced. This enables setting a title
181  with spaces and larger number of non-ASCII characters which is not
182  allowed as an alias for FvwmButtons module instance otherwise.
183
184*FvwmButtons: (options) [title icon command]::
185  Specifies the contents of a button in the buttonbox. The following
186  _options_, separated by commas or whitespace, can be given a button:
187
188+
189
190_geometry_:::
191    Specifies the size and position of the button within the FvwmButtons
192    window or container. The geometry is a standard X11 window geometry
193    specification. The button is _width_ times the normal button width
194    and _height_ times the normal button height. If values for _x_ and
195    _y_ are given, the button is placed x (y) button units from the left
196    (top) of the container if x (y) is positive and x (y) units from the
197    right (bottom) if x (y) is negative. Buttons with position arguments
198    (x and y) are placed before those without them. If two or more
199    buttons are forced to overlap by this, FvwmButtons exits with an
200    error message.
201+
202Action [(_options_)] _command_:::
203    Specifies an fvwm command to be executed when the button is
204    activated by pressing return or a mouse button. The _command_ needs
205    to be quoted if it contains a comma or a closing parenthesis.
206+
207
208The current options of the _Action_ are: Mouse _n_ - this action is
209only executed for mouse button _n_. One action can be defined for each
210mouse button, in addition to the general action.
211+
212In the _command_ part, you can use a number of predefined variables:
213_$left_, _$right_, _$top_ and _$bottom_ are substituted by the left,
214right, top and bottom coordinates of the button pressed. _$-left_,
215_$-right_, _$-top_ and _$-bottom_ are substituted likewise, but the
216coordinates are calculated from the bottom or the right edge of the
217screen instead (for a button that is 5 pixels away from the right
218screen border, $-right will be 5). _$width_ and _$height_ are replaced
219by the width or height of the button. The variables _$fg_ and _$bg_
220are replaced with the name of the foreground or background color set
221with the _Back_ or _Fore_ option (see below). All this is done
222regardless of any quoting characters. To get a literal '$' use the
223string '$$'.
224+
225Example:
226+
227....
228  *FvwmButtons: (Title xload, Action (Mouse 1) \
229    `Exec exec xload -fg $fg -bg $bg -geometry -3000-3000`)
230....
231+
232Note: With fvwm versions prior to 2.5.0, actions could not be assigned
233to a button that swallowed an application window (see _Swallow_
234option). Such actions worked only when the border around the button
235was clicked. This is now possible, but to get back the old behavior,
236the _ActionIgnoresClientWindow_ can be used on the button:
237+
238....
239  *FvwmButtons: (Action beep, ActionIgnoresClientWindow, \
240     Swallow xeyes "Exec exec xeyes")
241....
242+
243In this example, the action is only executed when you click on the
244border of the button or the transparent part of the xeyes window, but
245not on the xeyes window itself.
246+
247ActionIgnoresClientWindow:::
248    See the note in the description of _Action_ above.
249
250ActionOnPress:::
251    Usually the action is executed on the button release except for the
252    *Popup* action. This option changes this behavior, the action is
253    executed on the button press. This may be good, for example, with
254    *Menu* or *SendToModule* that generates popups, or when *Frame* is 0
255    and the button would look unresponsive otherwise.
256
257Back color:::
258    Specifies the background color to be used drawing this box. A relief
259    color and a shadow color are calculated from this.
260Center:::
261    The contents of the button is centered on the button. This is the
262    default but may be changed by _Left_ or _Right_.
263Top:::
264    The contents of the button is vertically aligned at the top of the
265    button. The default is to vertically center it.
266Colorset colorset:::
267    The given colorset can be applied to a container, a swallowed
268    application and a simple button. To apply it to a button or
269    container, simply put the option in a line with a button or
270    container description. Drawing backgrounds for individual buttons
271    and containers with colorsets requires a lot of communication with
272    the X server. So if you are not content with the drawing speed of
273    dozens of buttons with colorset backgrounds, do not use colorsets
274    here. Setting colorsets as the background of swallowed applications
275    does not have this restriction but depends entirely on the swallowed
276    application. It may work as you wish, but since it involves fiddling
277    with other applications' windows there is no guarantee for anything.
278    I have tested three applications: xosview works nicely with a
279    colorset background, xload works only with a VGradient or solid
280    background and an analog xclock leaves a trail painted in the
281    background color after its hands.
282+
283If the swallowed window is an fvwm module (see the (No)FvwmModule
284option to Swallow), then the _colorset_ is not applied to the
285swallowed module. You should use the _colorset_ in the module
286configuration. If the swallowed module has a transparent colorset
287background, then the FvwmButtons background (and not the button
288colorset) is seen by transparency of the background of the swallowed
289module. Refer to the fvwm man page for details about colorsets.
290
291ActiveColorset colorset:::
292    Use colorset _colorset_ for the background color/image and/or title
293    color of the button when the mouse is hovering above it.
294
295PressColorset colorset:::
296    Use colorset _colorset_ for the background color/image and/or title
297    color of the button when it is pressed.
298
299Container [(options)]:::
300    Specifies that this button will contain a miniature buttonbox,
301    equivalent to swallowing another FvwmButtons module. The options are
302    the same as can be given for a single button, but they affect all
303    the contained buttons. Options available for this use are _Back,
304    Font, Fore, Frame_ and _Padding_. Flags for Title and Swallow
305    options can be set with _Title(flags)_ and _Swallow(flags)_. You
306    should also specify either "Columns _width_" or "Rows _height_", or
307    "Rows 2" will be assumed. For an example, see the _Sample
308    configuration_ section.
309+
310The container button itself (separate from the contents) can take
311format options like _Frame_ and _Padding_, and commands can be bound
312to it. This means you can make a sensitive relief around a container,
313like
314+
315....
316  *FvwmButtons: (2x2, Frame 5, Padding 2 2, Action Beep,\
317      Container(Frame 1))
318....
319+
320Typically you will want to at least give the container a size setting
321__width__x_height_.
322
323End:::
324    Specifies that no more buttons are defined for the current
325    container, and further buttons will be put in the container's
326    parent. This option should be given on a line by itself, i.e
327+
328....
329  *FvwmButtons: (End)
330....
331+
332
333Font fontname:::
334    Specifies that the font _fontname_ is to be used for labeling this
335    button.
336Fore color:::
337    Specifies the foregound color of the title and monochrome icons in
338    this button.
339
340Frame width:::
341    The relief of the button will be _width_ pixels wide. If _width_ is
342    given as a negative number, the relief is inverted. This makes the
343    button sunken normally and raised when activated.
344
345Icon filename:::
346    The name of an image file, containing the icon to display on the
347    button. FvwmButtons searches through the path specified in the fvwm
348    ImagePath configuration item to find the icon file.
349
350ActiveIcon filename:::
351    The name of an image file, containing an alternative icon to display
352    on the button when the mouse is hovering above the button. If no
353    ActiveIcon is specified, the image specified by Icon is displayed
354    (if there is one).
355PressIcon filename:::
356    The name of an image file, containing an alternative icon to display
357    on the button when the button is pressed. If no PressIcon is
358    specified, the image specified by Icon is displayed (if there is one).
359
360Id id:::
361    The id to be used to identify this button. The first character of
362    the id should be alphabetic. See also the "DYNAMICAL ACTIONS"
363    section.
364
365Left:::
366    The contents of the button are aligned to the left. The default is
367    to center the contents on the button.
368
369NoSize:::
370    This option specifies that this button will not be considered at all
371    when making the initial calculations of button sizes. Useful for the
372    odd button that gets just a couple of pixels too large to keep in
373    line, and therefore blows up your whole buttonbox. "NoSize" is
374    equivalent to "Size 0 0".
375
376Padding width height:::
377    The amount of free space between the relief of the button and its
378    contents is normally 2 pixels to the sides and 4 pixels above and
379    below, except for swallowed windows and containers, which are by
380    default not padded at all. This option sets the horizontal padding
381    to _width_ and the vertical padding to _height_.
382
383Panel [ (options) ] hangon command:::
384    Panels can be swallowed exactly like windows are swallowed by
385    buttons with the _Swallow_ command below, but they are not displayed
386    within the button. Instead they are hidden until the user presses
387    the panel's button. Then the panel (the window of the swallowed
388    application) opens with a sliding animation. The _options_ can be
389    any of the _flags_ described for the Swallow command. In addition a
390    direction 'left', 'right', 'up' or 'down' can be used to specify the
391    sliding direction.
392+
393The _steps animation-steps_ option defines the number of animation steps.
394+
395The _delay ms_ option sets the delay between the steps of the
396animation in milliseconds. Use zero for no delay. The maximum delay is
39710 seconds (10000). It doesn't make any sense to use the delay option
398unless you also use the smooth option.
399+
400The _smooth_ option causes the panel to redraw between the steps of
401the animation. The sliding animation may be smoother this way, it
402depends on the application, and display speed. The application may
403appear to grow instead of sliding out. The animation may be slower.
404+
405The _Hints_ option causes FvwmButtons to use the applications size
406hints to calculate the size of the animation steps. _Hints_ is the
407default. If the number of steps is not what you want, try using
408_NoHints._
409+
410The _noborder_ option tells FvwmButtons to ignore the borders of the
411window when calculating positions for the animation (equivalent to set
412noplr and noptb in the position option).
413+
414With the _indicator_ option set, FvwmButtons will draw a small
415triangle in the button that will open a panel. The triangle points in
416the direction where the panel will pop up. The _indicator_ keyword may
417be followed by a positive integer that specifies the maximum width and
418height of the indicator. Without this size FvwmButtons will make the
419indicator fit the button. You will probably want to use the _Padding_
420option to leave a few pixels between the indicator and the frame of
421the button. Second option to indicator may be given which enters the
422look of the triangle. If this keyword is _in_, triangle will appear
423pressed in, while _out_ will make triangle to appear depressed (3D
424raised). If this keyword is omitted, default will be _out_ or
425depressed.
426+
427The _position_ option allows one to place the panel. The syntax is:
428+
429....
430position [context-window] [pos] [x y] [border-opts]
431....
432+
433The argument _context-window_ can be one of: Button, Module or Root.
434The _context-window_ is the window from which panel percentage offsets
435are calculated. Button specifies the panel's button, Module specifies
436FvwmButtons itself, and Root specifies a virtual screen. The
437context-window together with the sliding direction define a line
438segment which is one of the borders of the context-window: the
439top/bottom/left/right border for sliding up/down/left/right.
440+
441The _pos_ argument can be one of: center, left or right (for sliding
442up or a down) or top or bottom (for sliding left or right). It defines
443the vertical (sliding up and down) or the horizontal (sliding left and
444right) position of the Panel on the line segment. For example, for a
445sliding up if you use a left pos, then the left borders of the panel
446and of the context-window will be aligned.
447+
448The offset values _x_ and _y_ specify how far the panel is moved from
449it's default position. By default, the numeric value given is
450interpreted as a percentage of the context window's width (height). A
451trailing "p" changes the interpretation to mean "pixels". All offset
452calculations are relative to the buttons location, even when using a
453root context.
454+
455The _border-opts_ are: mlr, mtb, noplr and noptb. They define which
456border widths are taken in account. By default, the borders of
457FvwmButtons are not taken in account. mlr reverses this default for
458the left and the right border and mtb reverses this default for the
459top and the bottom border. Conversely, by default the borders of the
460Panel are taken in account. noplr reverses this default for the left
461and the right border and noptb reverses this default for the top and
462the bottom border.
463+
464The defaults are sliding up with a delay of five milliseconds and
465twelve animation steps. To post the panel without any animation, set
466the number of steps to zero. The default position is 'Button center'.
467+
468Please refer to the _CREATING PANELS_ section for further information
469on panels.
470+
471Example:
472+
473....
474  # To include the panel in a button
475  *FvwmButtons: (Panel(down, delay 0, steps 16) \
476    SubPanel "Module FvwmButtons SubPanel")
477
478  # To define the panel as an instance of
479  # FvwmButtons with a different name:
480  *SubPanel: (Icon my_lock.xpm, Action Exec xlock)
481  *SubPanel: (Icon my_move.xpm, Action Move)
482  ...
483....
484
485Right:::
486    The contents of the button are aligned to the right. The default is
487    to center the contents on the button.
488
489Size width height:::
490    Specifies that the contents of this button require _width_ by
491    _height_ pixels, regardless of what size FvwmButtons calculates from
492    the icon and the title. A button bar with only swallowed windows
493    will not get very large without this option specified, as
494    FvwmButtons does not consider sizes for swallowing buttons. Note
495    that this option gives the minimum space assured; other buttons
496    might require the buttonbox to use larger sizes.
497
498Swallow [(flags)] hangon command:::
499    Causes FvwmButtons to execute _command_, and when a window with a
500    name, class or resource matching _hangon_ appears, it is captured
501    and swallowed into this button. The _hangon_ string may contain
502    wildcard characters ('*') that match any substring. Swallow replaces
503    the variables _$fg_ and _$bg_ as described above for the _Action_
504    option (but if you use the UseOld and NoClose options the
505    application is not be restarted when FvwmButtons is restarted and
506    thus does not get the new colors - if you changed them). An example:
507+
508....
509  *FvwmButtons: (Swallow XClock 'Exec xclock -geometry -3000-3000 &')
510....
511+
512takes the first window whose name, class, or resource is "XClock" and
513displays it in the button. If no matching window is found, the "Exec"
514command creates one. The argument "-geometry -3000-3000" is used so
515that the window is first drawn out of sight before its swallowed into
516FvwmButtons.
517+
518Modules can be swallowed by specifying the module instead of 'Exec
519whatever', like:
520+
521....
522  *FvwmButtons: (Swallow "FvwmPager" "FvwmPager 0 0")
523....
524+
525The flags that can be given to swallow are:
526+
527NoClose / Close - Specifies whether the swallowed program in this
528button will be un-swallowed or closed when FvwmButtons exits cleanly.
529"NoClose" can be combined with "UseOld" to have windows survive a
530restart of the window manager. The default setting is "Close".
531+
532NoHints / Hints - Specifies whether hints from the swallowed program
533in this button will be ignored or not, useful in forcing a window to
534resize itself to fit its button. The default value is "Hints".
535+
536NoKill / Kill - Specifies whether the swallowed program will be closed
537by killing it or by sending a message to it. This can be useful in
538ending programs that doesn't accept window manager protocol. The
539default value is "NoKill". This has no effect if "NoClose" is
540specified.
541+
542NoRespawn / Respawn / SwallowNew - Specifies whether the swallowed
543program is to be respawned (restarted) if it dies. If "Respawn" is
544specified, the program is respawned using the original _command_. Use
545this option with care, the program might have a legitimate reason to
546die. If "SwallowNew" is given, the program is not respawned, but if a
547new window with the specified name appears, it is swallowed.
548+
549NoOld / UseOld - Specifies whether the button will try to swallow an
550existing window matching the _hangon_ name before spawning one itself
551with _command_. The _hangon_ string may contain wildcard characters
552('*') that match any substring.The default value is "NoOld". "UseOld"
553can be combined with "NoKill" to have windows survive a restart of the
554window manager. If you want FvwmButtons to swallow an old window, and
555not spawn one itself if failing, let the _command_ be "Nop":
556+
557....
558  *FvwmButtons: (Swallow (UseOld) "Console" Nop)
559....
560+
561If you want to be able to start it yourself, combine it with an action:
562+
563....
564  *FvwmButtons: (Swallow (UseOld) "Console" Nop, \
565               Action `Exec "Console" console &`)
566....
567+
568NoTitle / UseTitle - Specifies whether the title of the button will be
569taken from the swallowed window's title or not. If "UseTitle" is
570given, the title on the button changes dynamically to reflect the
571window name. The default is "NoTitle".
572+
573NoFvwmModule / FvwmModule - By default, FvwmButtons treats the
574swallowed window as an fvwm module window if the 4 first letters of
575the _command_ is "Fvwm" or the 6 first letters of the _command_ is
576"Module". NoFvwmModule and FvwmModule override this logic.
577+
578Title [(options)] name:::
579  Specifies the title to be written on the button. Whitespace can be
580  included in the title by quoting it. If a title at any time is too
581  long for its buttons, characters are chopped of one at a time until
582  it fits. If _justify_ is "Right", the head is removed, otherwise its
583  tail is removed. These _options_ can be given to Title:
584+
585Center - The title is centered horizontally. This is the default.
586+
587Left - The title is justified to the left side.
588+
589Right - The title is justified to the right side.
590+
591Side - Causes the title to appear on the right hand side of any icon
592or swallowed window, instead of below which is the default. If you use
593small icons, and combine this with the "Left" or "Right" option, you
594can get a look similar to fvwm's menus.
595+
596ActiveTitle name:::
597  Specifies the title to be written on the button when the mouse is
598  hovering above the button. If no ActiveTitle is specified, the text
599  specified by Title is displayed (if there is any).
600
601PressTitle name:::
602  Specifies the title to be written on the button when the button is
603  pressed. If no PressTitle is specified, the text specified by Title
604  is displayed (if there is any).
605
606Legacy fields [title icon command]:::
607  These fields are kept for compatibility with previous versions of
608  FvwmButtons, and their use is discouraged. The _title_ field is
609  similar to the option Title _name_. If the title field is "-", no
610  title is displayed. The _icon_ field is similar to the option Icon
611  _filename_. If the icon field is "-" no icon is displayed. The
612  _command_ field is similar to the option Action _command_ or
613  alternatively Swallow "_hangon_" _command_.
614
615The command:::
616  Any fvwm command is recognized by FvwmButtons. See fvwm(1) for more
617  information.
618+
619The Exec command has a small extension when used in Actions, its
620syntax is:
621+
622....
623  Exec ["hangon"] command
624....
625+
626Example:
627+
628....
629  *FvwmButtons: (Action Exec "xload" xload)
630....
631+
632The hangon string must be enclosed in double quotes. When FvwmButtons
633finds such an Exec command, the button remains pushed in until a
634window whose name, class or resource matches the quoted portion of the
635command is encountered. This is intended to provide visual feedback to
636the user that the action he has requested will be performed. The
637hangon string may contain wildcard characters ('*') that match any
638substring. If the quoted portion contains no characters, then the
639button will pop out immediately. Note that users can continue pressing
640the button, and re-executing the command, even when it looks pressed
641in.
642+
643Quoting:::
644  Any string which contains whitespace must be quoted. Contrary to
645  earlier versions commands no longer need to be quoted. In this case
646  any quoting character will be passed on to the application
647  untouched. Only commas ',' and closing parentheses ')' have to be
648  quoted inside a command. Quoting can be done with any of the three
649  quotation characters; single quote:
650+
651'This is a "quote"',
652+
653double quote:
654+
655"It's another `quote'",
656+
657and back quote:
658+
659`This is a strange quote`.
660+
661The back quoting is unusual but used on purpose, if you use a
662preprocessor like FvwmCpp and want it to get into your commands, like
663this:
664+
665....
666  #define BG gray60
667  *FvwmButtons: (Swallow "xload" `Exec xload -bg BG &`)
668....
669+
670Any single character can be quoted with a preceding backslash '\'.
671
672== CREATING PANELS
673
674Former versions of FvwmButtons (fvwm 2.0.46 to 2.3.6) had a different
675way of handling panels. You can not use your old panel configuration
676with the new panel feature. Read "CONVERTING OLD PANEL CONFIGURATIONS"
677for more information.
678
679=== HOW TO CREATE NEW PANELS
680
681Any program that can be launched from within fvwm and that has a window
682can be used as a panel. A terminal window could be your panel, or some
683application like xload or xosview or another fvwm module, including
684FvwmButtons itself. All you need to know is how to start your
685application from fvwm.
686
687The button that invokes the panel is as easily configured as any other
688button. Essentially you need nothing more than the _Panel_ option:
689
690....
691*FvwmButtons: (Panel my_first_panel \
692  "Module FvwmButtons -g -30000-30000 my_first_panel")
693*FvwmButtons: (Panel my_second_panel \
694  "Exec exec xterm -g -30000-30000 -n my_second_panel")
695....
696
697This works like the _Swallow_ option. The difference is that the
698application is not put into the button when it starts up but instead
699hidden from view. When you press the button for the panel the window
700slides into view. The '-g -30000-30000' option tells the application
701that it should be created somewhere very far to the top and left of your
702visible screen. Otherwise you would see it flashing for a moment when
703FvwmButtons starts up. Some applications do not work well with this kind
704of syntax so you may have to live with the short flashing of the window.
705If you want to make a panel from another instance of FvwmButtons you can
706do so, but you must give it a different name ('my_first_panel' in above
707example). If you run FvwmButtons under the same name, new panels are
708created recursively until your system runs out of resources and
709FvwmButtons crashes! To configure a second button bar with a different
710name, simply put '*new_name' in place of '*FvwmButtons' in your
711configuration file. If you are not familiar with the _Swallow_ option or
712if you want to learn more about how 'swallowing' panels works, refer to
713the description of the _Swallow_ option.
714
715Now that your panel basically works you will want to tune it a bit. You
716may not want a window title on the panel. To disable the title use the
717fvwm _Style_ command. If your button bar is 'sticky' you may want to
718make the panel sticky too. And probably the panel window should have no
719icon in case it is iconified.
720
721....
722Style name_of_panel_window NoTitle, Sitcky, NoIcon
723....
724
725You may want your panel to stay open only until you select something in
726it. You can give FvwmButtons the _-transientpanel_ option after the -g
727option in the command. FvwmPager has a similar option '-transient'.
728
729Last, but not least, you can now put an icon, a title or a small arrow
730in the button so that you can see what it is for. A title or icon can be
731specified as usual. To activate the arrow, just add '(indicator)' after
732the 'Panel' keyword in the example above and the _Padding_ option to
733leave a few pixels between the arrow and the border of the button. An
734optional direction in which the panel is opened can be given too:
735
736....
737*FvwmButtons: (Padding 2, Panel(down, indicator) my_first_panel \
738  "Module FvwmButtons -g -30000-30000 -transientpanel my_first_panel")
739....
740
741There are several more options to configure how your panel works, for
742example the speed and smoothness of the sliding animation. Please refer
743to the description of the _Panel_ option for further details.
744
745=== CONVERTING OLD PANEL CONFIGURATIONS
746
747This section describes how to convert a pretty old syntax used in 2.2.x
748versions. You may skip it if your syntax is more recent.
749
750With the old panel feature you first had one or more lines defining
751panels in your main FvwmButtons configuration:
752
753....
754...
755*FvwmButtons(Title WinOps,Panel WinOps)
756*FvwmButtons(Title Tools ,Panel Tools)
757...
758....
759
760After the last configuration line for the main panel the configuration
761of the first panel followed, introduced with a line beginning with
762*FvwmButtonsPanel:
763
764....
765*FvwmButtonsPanel WinOps
766*FvwmButtonsBack bisque2
767...
768
769*FvwmButtonsPanel Tools
770*FvwmButtonsBack bisque2
771...
772....
773
774And perhaps you had style commands for you panels:
775
776....
777Style FvwmButtonsPanel Title, NoHandles, BorderWidth 0
778Style FvwmButtonsPanel NoButton 2, NoButton 4, Sticky
779....
780
781The new configuration looks much the same, but now the configuration of
782the main panel is independent of the configuration of the sub panels.
783The lines invoking the panels use the same syntax as the Swallow option,
784so you simply add the name of the window to use as a panel and the
785command to execute instead of the panel name. Note that you give the new
786instance of FvwmButtons a different name.
787
788....
789*FvwmButtons: (Title WinOps, Panel WinOps \
790  "Module FvwmButtons WinOps")
791*FvwmButtons: (Title Tools , Panel Tools \
792  "Module FvwmButtons Tools")
793....
794
795If you used something like 'Panel-d' you now have to use 'Panel(down)'
796instead. To make the new panel vanish as soon as a button was selected
797start FvwmButtons with the '-transientpanel' option:
798
799....
800*FvwmButtons: (Title Tools , Panel(down) Tools \
801  "Module FvwmButtons -transientpanel Tools")
802....
803
804The rest of the configuration is very easy to change. Delete the lines
805'*FvwmButtonsPanel <name>' and add <name> to all of the following
806configuration lines for the panel instead. Use the same name in your
807Style commands:
808
809....
810*WinOps: Back bisque2
811...
812*Tools: Back bisque2
813...
814Style "WinOps" Title, NoHandles, BorderWidth 0
815Style "WinOps" NoButton 2, NoButton 4, Sticky
816Style "Tools" Title, NoHandles, BorderWidth 0
817Style "Tools" NoButton 2, NoButton 4, Sticky
818....
819
820That's it. The new panels are much more flexible. Please refer to other
821parts of this documentation for details.
822
823=== WHY WAS THE PANEL FEATURE REWRITTEN?
824
825There are several reasons. The most important one is that the program
826code implementing the panels was very disruptive and caused a lot of
827problems. At the same time it made writing new features for FvwmButtons
828difficult at best. The second reason is that most users were simply
829unable to make it work - it was way too complicated. Even I (the author
830of the new code) had to spend several hours before I got it working the
831first time. The third reason is that the new panels are more versatile.
832Any application can be a panel in FvwmButtons, not just other instances
833of FvwmButtons itself. So I sincerely hope that nobody is angry about
834the change. Yes - you have to change your configuration, but the new
835feature is much easier to configure, especially if you already know how
836the Swallow option works.
837
838== ARRANGEMENT ALGORITHM
839
840FvwmButtons tries to arrange its buttons as best it can, by using
841recursively, on each container including the buttonbox itself, the
842following algorithm.
843
844Getting the size right::
845  First it calculates the number of button unit areas it will need, by
846  adding the width times the height in buttons of each button.
847  Containers are for the moment considered a normal button. Then it
848  considers the given _rows_ and _columns_ arguments. If the number of
849  rows is given, it will calculate how many columns are needed, and
850  stick to that, unless _columns_ is larger, in which case you will get
851  some empty space at the bottom of the buttonbox. If the number of
852  columns is given, it calculates how many rows it needs to fit all the
853  buttons. If neither is given, it assumes you want two rows, and finds
854  the number of columns from that. If the BoxSize option is set to
855  _smart_ at least the height/width of the tallest/widest button is used
856  while the _fixed_ value prevents the box from getting resized if both
857  _rows_ and _columns_ have been set to non-zero.
858Shuffling buttons::
859  Now it has a large enough area to place the buttons in, all that is
860  left is to place them right. There are two kinds of buttons: fixed and
861  floating buttons. A fixed button is forced to a specific slot in the
862  button box by a x/y geometry argument. All other buttons are
863  considered floating. Fixed buttons are placed first. Should a fixed
864  button overlap another one or shall be place outside the buttons
865  window, FvwmButtons exits with an error message. After that the
866  floating buttons are placed. The algorithm tries to place the buttons
867  in a left to right, top to bottom western fashion. If a button fits at
868  the suggested position it is placed there, if not the current slot
869  stays empty and the slot to the right will be considered. After the
870  button has been placed, the next button is tried to be placed in the
871  next slot and so on until all buttons are placed. Additional rows are
872  added below the bottom line of buttons until all buttons are placed if
873  necessary if the BoxSize option _smart_ is used.
874Containers::
875  Containers are arranged by the same algorithm, in fact they are
876  shuffled recursively as the algorithm finds them.
877Clarifying example::
878  An example might be useful here: Suppose you have 6 buttons, all unit
879  sized except number two, which is 2x2. This makes for 5 times 1 plus 1
880  times 4 equals 9 unit buttons total area. Assume you have requested 3
881  columns.
882
883....
8841) +---+---+---+   2) +---+---+---+   3) +---+---+---+
885   | 1 |       |      | 1 |       |      | 1 |       |
886   +---+       +      +---+   2   +      +---+   2   +
887   |           |      |   |       |      | 3 |       |
888   +           +      +   +---+---+      +---+---+---+
889   |           |      |           |      |   |   |   |
890   +-----------+      +---+-------+      +---+---+---+
891
8924) +---+---+---+   5) +---+-------+   6) +---+-------+
893   | 1 |       |      | 1 |       |      | 1 |       |
894   +---+   2   +      +---+   2   |      +---+   2   |
895   | 3 |       |      | 3 |       |      | 3 |       |
896   +---+---+---+      +---+---+---+      +---+-------+
897   | 4 |       |      | 4 | 5 |   |      | 4 | 5 | 6 |
898   +---+---+---+      +---+---+---+      +---+---+---+
899....
900
901What size will the buttons be?::
902  When FvwmButtons has read the icons and fonts that are required by its
903  configuration, it can find out which size is needed for every
904  non-swallowing button. The unit button size of a container is set to
905  be large enough to hold the largest button in it without squeezing it.
906  Swallowed windows are simply expected to be comfortable with the
907  button size they get from this scheme. If a particular configuration
908  requires more space for a swallowed window, it can be set in that
909  button's configuration line using the option "Size _width height_".
910  This will tell FvwmButtons to give this button at least _width_ by
911  _height_ pixels inside the relief and padding.
912
913== DYNAMICAL ACTIONS
914
915A running FvwmButtons instance may receive some commands at run time.
916This is achieved using the fvwm command
917
918....
919SendToModule FvwmButtons-Alias <action> <params>
920....
921
922Supported actions:
923
924ChangeButton button_id options::
925  can be used to change the title or icon of a button at run time.
926  _button_id_ is the id of the button to change as specified using the
927  *Id* button option. It may also be a number, in this case the button
928  with the given number is assumed. And finally, _button_id_ may be in
929  the form +x+y, where x and y are a column number and a row number of
930  the button to be changed. It is possible to specify multiple option
931  pairs (name with value) by delimiting them using comma. Currently
932  options include *Title*, *ActiveTitle*, *PressTitle*, *Colorset*,
933  *Icon*, *ActiveIcon* and *PressIcon*. These options work like the
934  configuration options of the same name.
935ExpandButtonVars button_id command::
936  replaces variables present in the _command_ exactly like in the
937  *Action* button option and then sends the command back to fvwm.
938  _button_id_ has the same syntax as described in *ChangeButton* above.
939PressButton button_id [mouse_button]::
940  simulates a mouse click on a button. _button_id_ is the id of the
941  button to press as specified using the *Id* button option and
942  _mouse_button_ is the number of mouse button used to click on the
943  button e.g "1" for the left mouse button etc. Quotes around the number
944  are not necessary. If _mouse_button_ option is omitted, mouse button 1
945  is assumed. This command behaves exactly as if the mouse button was
946  pressed and released on the button on in question.
947Silent::
948  This prefix may be specified before other actions. It disables all
949  possible error and warning messages.
950Example:::
951
952....
953*FvwmButtons: (Id note1, Title "13:30 - Dinner", Icon clock1.xpm)
954
955SendToModule FvwmButtons Silent \
956  ChangeButton note1 Icon clock2.xpm, Title "18:00 - Go Home"
957....
958
959== SAMPLE CONFIGURATION
960
961The following are excerpts from a .fvwm2rc file which describe
962FvwmButtons initialization commands:
963
964....
965##########################################################
966# Load any modules which should be started during fvwm
967# initialization
968
969# Make sure FvwmButtons is always there.
970AddToFunc StartFunction  "I" Module FvwmButtons
971
972# Make it titlebar-less, sticky, and give it an icon
973Style "FvwmButtons"	Icon toolbox.xpm, NoTitle, Sticky
974
975# Make the menu/panel look like CDE
976Style "WinOps" Title, NoHandles, BorderWidth 0
977Style "WinOps" NoButton 2, NoButton 4, Sticky
978Style "Tools" Title, NoHandles, BorderWidth 0
979Style "Tools" NoButton 2, NoButton 4, Sticky
980
981##########################################################
982DestroyModuleConfig FvwmButtons: *
983*FvwmButtons: Fore Black
984*FvwmButtons: Back rgb:90/80/90
985*FvwmButtons: Geometry -135-5
986*FvwmButtons: Rows 1
987*FvwmButtons: BoxSize smart
988*FvwmButtons: Font -*-helvetica-medium-r-*-*-12-*
989*FvwmButtons: Padding 2 2
990
991*FvwmButtons: (Title WinOps, Panel WinOps \
992  "Module FvwmButtons -transientpanel WinOps")
993*FvwmButtons: (Title Tools, Panel Tools   \
994  "Module FvwmButtons -transientpanel Tools")
995
996*FvwmButtons: (Title Resize, Icon resize.xpm,  Action Resize)
997*FvwmButtons: (Title Move,   Icon arrows2.xpm, Action Move  )
998*FvwmButtons: (Title Lower,  Icon Down,        Action Lower )
999*FvwmButtons: (Title Raise,  Icon Up,          Action Raise )
1000*FvwmButtons: (Title Kill,   Icon bomb.xpm,    Action Destroy)
1001
1002*FvwmButtons: (1x1,Container(Rows 3,Frame 1))
1003*FvwmButtons: (Title Dopey ,Action                          \
1004    `Exec "big_win" xterm -T big_win -geometry 80x50 &`)
1005*FvwmButtons: (Title Snoopy, Font fixed, Action             \
1006    `Exec "small_win" xterm -T small_win &`)
1007*FvwmButtons: (Title Smokin')
1008*FvwmButtons: (End)
1009
1010*FvwmButtons: (Title Xcalc, Icon rcalc.xpm,                 \
1011             Action `Exec "Calculator" xcalc &`)
1012*FvwmButtons: (Title XMag, Icon magnifying_glass2.xpm,      \
1013             Action `Exec "xmag" xmag &`)
1014*FvwmButtons: (Title Mail, Icon mail2.xpm,                  \
1015             Action `Exec "xmh" xmh &`)
1016*FvwmButtons: (4x1, Swallow "FvwmPager" `FvwmPager 0 3`     \
1017             Frame 3)
1018
1019*FvwmButtons: (Swallow(UseOld,NoKill) "xload15" `Exec xload \
1020     -title xload15 -nolabel -bg rgb:90/80/90 -update 15    \
1021     -geometry -3000-3000 &`)
1022....
1023
1024The last lines are a little tricky - one spawns an FvwmPager module, and
1025captures it to display in a quadruple width button. is used, the Pager
1026will be as big as possible within the button's relief.
1027
1028The final line is even more magic. Note the combination of _UseOld_ and
1029_NoKill_, which will try to swallow an existing window with the name
1030"xload15" when starting up (if failing: starting one with the specified
1031command), which is un-swallowed when ending FvwmButtons. The swallowed
1032application is started with "-geometry -3000-3000" so that it will not
1033be visible until its swallowed.
1034
1035The other panels are specified after the root panel:
1036
1037....
1038########## PANEL WinOps
1039DestroyModuleConfig WinOps: *
1040*WinOps: Back bisque2
1041*WinOps: Geometry -3-3
1042*WinOps: Columns 1
1043
1044*WinOps: (Title Resize, Icon resize.xpm,  Action Resize)
1045*WinOps: (Title Move,   Icon arrows2.xpm, Action Move  )
1046*WinOps: (Title Lower,  Icon Down,        Action Lower )
1047*WinOps: (Title Raise,  Icon Up,          Action Raise )
1048
1049########## PANEL Tools
1050DestroyModuleConfig Tools: *
1051*Tools: Back bisque2
1052*Tools: Geometry -1-1
1053*Tools: Columns 1
1054
1055*Tools: (Title Kill,    Icon bomb.xpm,    Action Destroy)
1056....
1057
1058The color specification _rgb:90/80/90_ is actually the most correct way
1059of specifying independent colors in X, and should be used instead of the
1060older _#908090_. If the latter specification is used in your
1061configuration file, you should be sure to escape the hash in any of the
1062__command__s which will be executed, or fvwm will consider the rest of
1063the line a comment.
1064
1065Note that with the x/y geometry specs you can easily build button
1066windows with gaps. Here is another example. You can not accomplish this
1067without geometry specs for the buttons:
1068
1069....
1070##########################################################
1071# Another example
1072##########################################################
1073
1074# Make it titlebar-less, sticky, and give it an icon
1075Style "FvwmButtons"	Icon toolbox.xpm, NoTitle, Sticky
1076
1077DestroyModuleConfig FvwmButtons: *
1078*FvwmButtons: Font        5x7
1079*FvwmButtons: Back rgb:90/80/90
1080*FvwmButtons: Fore        black
1081*FvwmButtons: Frame       1
1082# 9x11 pixels per button, 4x4 pixels for the frame
1083*FvwmButtons: Geometry    580x59+0-0
1084*FvwmButtons: Rows        5
1085*FvwmButtons: Columns     64
1086*FvwmButtons: BoxSize     fixed
1087*FvwmButtons: Padding     1 1
1088
1089# Pop up a module menu directly above the button.
1090*FvwmButtons: (9x1+3+0, Padding 0, Title "Modules",   \
1091  Action `Menu Modulepopup rectangle \
1092  $widthx$height+$lleft+$top o+50 -100m`)
1093
1094# first row of buttons from left to right:
1095*FvwmButtons: (3x2+0+1, Icon my_lock.xpm, Action `Exec xlock`)
1096*FvwmButtons: (3x2+3+1, Icon my_recapture.xpm, Action Recapture)
1097*FvwmButtons: (3x2+6+1, Icon my_resize.xpm, Action Resize)
1098*FvwmButtons: (3x2+9+1, Icon my_move.xpm, Action Move)
1099*FvwmButtons: (3x2+12+1, Icon my_fvwmconsole.xpm,     \
1100  Action 'Module FvwmConsole')
1101
1102# second row of buttons from left to right:
1103*FvwmButtons: (3x2+0+3, Icon my_exit.xpm, Action QuitSave)
1104*FvwmButtons: (3x2+3+3, Icon my_restart.xpm, Action Restart)
1105*FvwmButtons: (3x2+6+3, Icon my_kill.xpm, Action Destroy)
1106*FvwmButtons: (3x2+9+3, Icon my_shell.xpm, Action 'Exec rxvt')
1107
1108# big items
1109*FvwmButtons: (10x5, Swallow (NoKill, NoCLose)        \
1110  "FvwmPager" 'FvwmPager * * -geometry 40x40-1024-1024')
1111*FvwmButtons: (6x5, Swallow "FvwmXclock" `Exec xclock \
1112  -name FvwmXclock -geometry 40x40+0-3000 -padding 1  \
1113  -analog -chime -bg rgb:90/80/90`)
1114*FvwmButtons: (13x5, Swallow (NoClose)                \
1115"FvwmIconMan" 'Module FvwmIconMan')
1116*FvwmButtons: (20x5, Padding 0, Swallow "xosview"     \
1117  `Exec /usr/X11R6/bin/xosview -cpu -int -page -net   \
1118  -geometry 100x50+0-3000 -font 5x7`)
1119....
1120
1121== BUGS
1122
1123The action part of the Swallow option must be quoted if it contains any
1124whitespace character.
1125
1126== HISTORY
1127
1128The FvwmButtons program, and the concept for interfacing this module to
1129the Window Manager, are all original work by Robert Nation.
1130
1131Originally, FvwmGoodStuff preceded FvwmButtons.
1132
1133== AUTHOR
1134
1135Robert Nation (1993). Somewhat enhanced by Jarl Totland (1996),
1136Jui-Hsuan Joshua Feng, Scott Smedley.
1137