FvwmButtons(1)
โจ FvwmButtons(1) โจ
Fvwm Modules section, bestie ๐ this one is all about the buttonbox ๐
๐ง NAME ๐ง
okay so FvwmButtons is literally the fvwm buttonbox module โจ
๐ SYNOPSIS ๐
Module FvwmButtons [-g geometry] [-transient | -transientpanel] [name[configfile]]
ngl, FvwmButtons can only be invoked by fvwm ๐
โโ๏ธ Command line invocation of the FvwmButtons module will not work. ๐
๐ฆ DESCRIPTION ๐ฆ
The FvwmButtons module gives you a window of buttons that sits on the X terminal's root window ๐ธ Anytime, you can press a button and the window manager will run a user-specified command for you. FvwmButtons only works when fvwm is used as the window manager, so no other WM vibes here ๐
The buttonbox can be any configuration or geometry you want ๐ and it can have monochrome or color icons for the actions it's going to invoke. Even other applications can get swallowed by the button bar ๐ญ literally iconic.
Panels that open on a button press are available too โจ check the CREATING PANELS section for all the deets.
๐ OPTIONS ๐
-g geometryโ sets the geometry of the main window. The command line option slays any other geometry settings in the configuration file ๐-transientโ tells FvwmButtons to shut itself down after the first key or button press has been received (presses that open a sub panel don't count) or after a sub panel has been closed or respawned. This is especially useful for sub panels where you want to pick one button and have it closed automatically ๐ซถ It could even be used to make two-dimensional graphical menus. Since-transientis an option and not a configuration setting, you can use the same configuration for transient and non-transient button bars ๐ง-transientpanelโ does roughly the same thing as-transient, but instead of closing the whole button bar, the window is merely hidden ๐ This is very useful if the button bar is started as a subpanel of another button bar, because it means it doesn't have to be started again every time something gets selected ๐
๐ INVOCATION ๐
FvwmButtons is spawned by fvwm, so command line invocation won't work. ๐
FvwmButtons can be invoked by inserting the line Module FvwmButtons OptionalName in the .fvwm2rc file. This should be placed in the StartFunction if FvwmButtons is to be spawned during fvwm's initialization. It can also be bound to a menu, mouse button or keystroke to invoke it later ๐ฆ
When invoked with the OptionalName argument, the OptionalName is used to find configuration commands. For example:
AddToFunc StartFunction Module FvwmButtons MyButtonBox
FvwmButtons will then use only the lines starting with "*MyButtonBox", instead of the default "*FvwmButtons". Main character energy ๐
๐ CONFIGURATION OPTIONS ๐
The following commands are understood by FvwmButtons, so let's get into it ๐
*FvwmButtons: Back color
Sets the background color for the buttons ๐ธ The relief and shadow color get calculated from the background color, so you don't have to do that math yourself ๐งฎ
*FvwmButtons: BoxSize algorithm
This one decides how seriously FvwmButtons takes the Rows and Columns options (see below) ๐ฅ It can be dumb, fixed or smart.
If fixed is used and both Rows and Columns are specified and non-zero, FvwmButtons uses exactly the number of rows and columns you asked for. โ ๏ธ If the box is too small to accommodate all the buttons, the module will fail ๐
If smart is used, FvwmButtons enlarges the box so all the buttons have a chance to fit ๐ The number of columns is increased to at least the width of the widest button, and new rows are added until every button is placed. For the best tolerance of configuration errors, use the smart option ๐ซถ
dumb is neither fixed nor smart. This is the default โจ
*FvwmButtons: Colorset colorset
Tells the module to use colorset colorset for the window background ๐จ Refer to the fvwm man page for the deets on colorsets.
*FvwmButtons: ActiveColorset colorset
Tells the module to use colorset colorset for the background color/image and/or title color of a button while the mouse is hovering above it ๐ฆ
*FvwmButtons: PressColorset colorset
Tells the module to use colorset colorset for the background color/image and/or title color of a button when it's pressed ๐
*FvwmButtons: Columns columns
Specifies how many columns of buttons get created ๐ If it's unspecified, the number of columns is set to the number of buttons requested, divided by the number of rows. If both the rows and columns are specified, but the number of buttons is more than the rows and columns can hold, the columns specification is ignored unless the BoxSize option is fixed ๐
*FvwmButtons: File filename
Specifies that the configuration for this button lives in the file filename ๐ filename can be a full pathname, or it's assumed to be in fvwm's startup directory. The configuration file uses the same format as fvwm's configuration file, but each line is read as if it's prefixed by "*FvwmButtons". Comments are made by starting a line with "#". Line continuation is done by ending a line with a "\" ๐ง
*FvwmButtons: Font font
Specifies the font used for labeling the buttons, or None ๐ค
*FvwmButtons: Fore color
Specifies the color used for button label text and monochrome icons ๐
*FvwmButtons: Frame width
Specifies the width of the relief around each button โจ If this is a negative number, the relief is inverted. This makes the button sunken normally and raised when it's activated ๐ซถ
*FvwmButtons: Geometry geometry
Specifies the FvwmButtons window location and size ๐ The geometry is a standard X11 window geometry specification.
*FvwmButtons: ButtonGeometry geometry
This one works like Geometry, except the size is the size of a single button ๐ The size of the whole FvwmButtons window gets calculated by multiplying the button dimension by the number of rows and columns ๐งฎ
*FvwmButtons: Padding width height
Sets the default horizontal padding to width pixels, and the vertical padding to height pixels ๐
The free space between a button's relief and its contents is normally 2 pixels on the sides and 4 pixels above and below. The exception is swallowed windows and containers, which aren't padded at all unless this option is used ๐ธ
*FvwmButtons: Pixmap pixmapfile
Specifies a background pixmap to use ๐ผ๏ธ Specify "none" (without the double quotes) for a transparent background ๐ฆ
*FvwmButtons: Rows rows
Specifies the number of rows of buttons to be created. The default is 2 rows ๐
*FvwmButtons: (options) [title icon command]
Specifies the contents of a button in the buttonbox ๐ The following options, separated by commas or whitespace, can be given to a button:
geometry
Sets the size and position of the button within the FvwmButtons window or container ๐ The geometry is a standard X11 window geometry specification. The button is width times the normal button width and height times the normal button height. If values for x and y are given, the button is placed x (y) button units from the left (top) of the container if x (y) is positive, and x (y) units from the right (bottom) if x (y) is negative. Buttons with position arguments (x and y) get placed before the ones without them. If two or more buttons are forced to overlap by this, FvwmButtons exits with an error message ๐
Action [(options)] command
Specifies an fvwm command to run when the button gets activated by pressing return or a mouse button ๐ฅ The command needs to be quoted if it contains a comma or a closing parenthesis.
The current options of the Action are: Mouse n, which means this action is only executed for mouse button n. One action can be defined for each mouse button, in addition to the general action ๐ฑ๏ธ
In the command part, you can use a bunch of predefined variables ๐ง $left, $right, $top and $bottom get substituted by the left, right, top and bottom coordinates of the button that was pressed. $-left, $-right, $-top and $-bottom are substituted likewise, but the coordinates are calculated from the bottom or the right edge of the screen instead (so for a button that's 5 pixels away from the right screen border, $-right will be 5). $width and $height get replaced by the width or height of the button. The variables $fg and $bg are replaced with the name of the foreground or background color set with the Back or Fore option (see below). All this happens regardless of any quoting characters. To get a literal $, use the string $$ ๐
Example:
*FvwmButtons: (Title xload, Action (Mouse 1) \
`Exec exec xload -fg $fg -bg $bg -geometry -3000-3000`)
Note: With fvwm versions prior to 2.5.0, actions could not be assigned to a button that swallowed an application window (seeSwallowoption). Such actions only worked when the border around the button was clicked ๐ This is now possible, but to get back the old behavior, theActionIgnoresClientWindowcan be used on the button:
*FvwmButtons: (Action beep, ActionIgnoresClientWindow, \
Swallow xeyes "Exec exec xeyes")
In this example, the action is only executed when you click on the border of the button or the transparent part of the xeyes window, but not on the xeyes window itself ๐
ActionIgnoresClientWindow
See the note in the description of Action above ๐ซถ
ActionOnPress
Usually the action is executed on the button release, except for the Popup action. This option flips that, so the action is executed on the button press instead ๐ฅ This may be good, for example, with Menu or SendToModule that generate popups, or when Frame is 0 and the button would otherwise look unresponsive ๐ญ
Back color
Specifies the background color to be used when drawing this box. A relief color and a shadow color are calculated from this ๐
Center: The contents sit smack in the middle of the button ๐. That's the default, but you can switch it up withLeftorRightif you want something different ๐ .Top: The contents hug the top of the button instead of floating in the middle ๐ฆ. By default it's vertically centred, so only use this if you want that top-aligned look โจ.
๐ Colorset colorset
Okay so a colorset can be slapped onto a container, a swallowed application, or a simple button ๐. To apply it, just put the option on the same line as that button or container's description ๐ .
โ ๏ธ Bestie, real talk: painting individual buttons and containers with colorsets means a LOT of chatting with the X server ๐ญ. If you're not happy with how fast dozens of buttons with colorset backgrounds draw, don't use colorsets here ๐.
Colorsets as the background of swallowed applications don't have that same speed problem ๐, but how it looks depends entirely on the swallowed app ๐คทโโ๏ธ. It might work exactly how you want, but since it means fiddling with other apps' windows, there's zero guarantee for anything ๐ญ. I tested three apps: xosview looks gorgeous with a colorset background ๐ฅ, xload only works with a VGradient or solid background ๐, and an analog xclock leaves a trail painted in the background color after its hands โฐ (not it ๐).
If the swallowed window is an fvwm module (see the (No)FvwmModule option to Swallow), the colorset does NOT get applied to it ๐
โโ๏ธ. You need to use the colorset in the module's own configuration instead ๐ง. And if the swallowed module has a transparent colorset background, what you see through it is the FvwmButtons background, not the button colorset ๐ธ. Refer to the fvwm man page for the deets on colorsets ๐.
ActiveColorset colorset: When your mouse is hovering over the button ๐, this uses colorsetcolorsetfor its background color/image and/or title color.PressColorset colorset: Same energy, but this kicks in when the button is pressed ๐.
๐ฆ Container [(options)]
This makes the button a mini buttonbox, basically the same as swallowing another FvwmButtons module ๐ง. The options are the same ones you'd give a single button, but they affect every button inside ๐. For containers, you can use Back, Font, Fore, Frame and Padding ๐. Flags for Title and Swallow can be set with Title(flags) and Swallow(flags) โจ.
โ ๏ธ You should also give eitherColumns widthorRows height, or elseRows 2gets assumed ๐. For an example, check out the Sample configuration section ๐.
The container button itself (separate from its contents) can take format options like Frame and Padding, and you can bind commands to it ๐. This means you can make a sensitive relief around a container, like this:
*FvwmButtons: (2x2, Frame 5, Padding 2 2, Action Beep,\
Container(Frame 1))
Typically you'll want to at least give the container a size setting widthxheight ๐
.
๐ End
This says no more buttons are defined for the current container ๐ โโ๏ธ, so any further buttons get put in the container's parent ๐ธ. Give it on a line by itself, like this:
*FvwmButtons: (End)
Font fontname: Uses the fontfontnamefor labeling this button ๐ค.Fore color: Sets the foreground color for the title and monochrome icons on this button ๐จ.Frame width: The relief of the button getswidthpixels wide ๐ผ๏ธ. If you give a negative number, the relief flips, so the button looks sunken normally and pops up raised when activated ๐ญ๐ฅ.Icon filename: The name of an image file with the icon you want on the button ๐ผ๏ธ. FvwmButtons searches through the path in the fvwmImagePathconfiguration item to find it ๐.ActiveIcon filename: An alternative icon for when the mouse is hovering over the button ๐. If you don't specify one, theIconimage gets shown instead (if there is one) ๐.PressIcon filename: An alternative icon for when the button is pressed ๐. If there's noPressIcon, theIconimage gets shown instead (if there is one) ๐ซถ.Id id: The id used to identify this button ๐. The first character should be alphabetic ๐ค. See also the "DYNAMICAL ACTIONS" section ๐ฆ.Left: Aligns the contents to the left ๐. The default is to center the contents on the button ๐.NoSize: This button won't be considered at all when making the initial calculations of button sizes ๐. It's useful for that one odd button that's just a couple of pixels too large and ends up blowing up your whole buttonbox ๐.NoSizeis equivalent toSize 0 0โจ.Padding width height: The free space between the relief of the button and its contents is normally 2 pixels to the sides and 4 pixels above and below ๐ธ. Swallowed windows and containers are by default not padded at all ๐ โโ๏ธ. This option sets the horizontal padding towidthand the vertical padding toheight๐.
๐ธ Panel [ (options) ] hangon command
Panels can be swallowed exactly like windows are swallowed by buttons with the Swallow command below ๐ง. The difference is they're NOT displayed within the button ๐. Instead, they stay hidden until the user presses the panel's button, and then the panel (the window of the swallowed application) slides open with an animation ๐. The options can be any of the flags described for the Swallow command ๐
. You can also use a direction left, right, up or down to set the sliding direction ๐ฆ.
steps animation-steps: Sets the number of animation steps ๐ช.delay ms: Sets the delay between the steps of the animation, in milliseconds โฑ๏ธ. Use zero for no delay ๐ โโ๏ธ. The maximum delay is 10 seconds (10000) ๐. It doesn't make any sense to use thedelayoption unless you also use thesmoothoption ๐ญ.smooth: Makes the panel redraw between the steps of the animation ๐. The sliding might look smoother this way, but it depends on the application and display speed ๐คทโโ๏ธ. The application may appear to grow instead of sliding out, and the animation may be slower ๐ข.Hints: Tells FvwmButtons to use the application's size hints to calculate the size of the animation steps ๐.Hintsis the default ๐. If the number of steps isn't what you want, tryNoHints๐.noborder: Tells FvwmButtons to ignore the borders of the window when calculating positions for the animation ๐ผ๏ธ. This is equivalent to settingnoplrandnoptbin thepositionoption ๐ง .indicator: With this on, FvwmButtons draws a small triangle in the button that opens the panel ๐บ. The triangle points in the direction where the panel will pop up โฌ๏ธ. You can followindicatorwith a positive integer for the maximum width and height of the indicator ๐. Without that size, FvwmButtons makes the indicator fit the button ๐ . You'll probably want to use thePaddingoption to leave a few pixels between the indicator and the frame of the button โจ.position: This lets you place the panel ๐. The syntax is:
position [context-window] [pos] [x y] [border-opts]
context-windowcan beButton,ModuleorRoot๐ช. This is the window that panel percentage offsets get calculated from.Buttonis the panel's button,Moduleis FvwmButtons itself, andRootis a virtual screen ๐. The context-window and the sliding direction together define a line segment, which is one of the borders of the context-window: the top/bottom/left/right border for sliding up/down/left/right ๐.poscan becenter,leftorright(for sliding up or down), ortoporbottom(for sliding left or right) ๐ฏ. It sets the vertical (sliding up and down) or horizontal (sliding left and right) position of the Panel on that line segment ๐. For example, if you slide up and use aleftpos, the left borders of the panel and the context-window get aligned ๐.x yare the offset values, and they say how far the panel moves from its default position ๐ฆ. By default, the number you give is read as a percentage of the context window's width (height) ๐. Add a trailingpand it switches to pixels ๐. All offset calculations are relative to the button's location, even when you're using a root context ๐ซถ.
The border-opts are mlr, mtb, noplr and noptb ๐
, and they decide which border widths get counted ๐. By default the borders of FvwmButtons are NOT counted ๐. mlr flips that for the left and right borders, and mtb flips it for the top and bottom. The Panel is the opposite: its borders ARE counted by default, so noplr flips that for the left and right, and noptb flips it for the top and bottom โจ.
The defaults are a slide-up ๐ง with a five millisecond delay and twelve animation steps. If you want the panel to pop up with zero animation, set the steps to 0. The default position is 'Button center' ๐.
Go peek at the CREATING PANELS section for more panel tea ๐ซ.
Example:
# To include the panel in a button
*FvwmButtons: (Panel(down, delay 0, steps 16) \
SubPanel "Module FvwmButtons SubPanel")
# To define the panel as an instance of
# FvwmButtons with a different name:
*SubPanel: (Icon my_lock.xpm, Action Exec xlock)
*SubPanel: (Icon my_move.xpm, Action Move)
...
โจ Right
The contents of the button get lined up to the right ๐. By default they're centered, so this is for when you want that right-side glow ๐.
๐ Size width height
Tells the button that its contents need at least width by height pixels ๐ฆ, no matter what size FvwmButtons would have figured out from the icon and title. If your button bar only has swallowed windows, it won't get very big without this, because FvwmButtons doesn't count sizes for swallowing buttons ๐ฅฒ. This only sets the minimum space it's guaranteed though. Other buttons might make the buttonbox go bigger.
๐ซง Swallow [(flags)] hangon command
FvwmButtons runs command, and when a window whose name, class or resource matches hangon shows up, it gets captured and swallowed into this button ๐. The hangon string can use * wildcards to match any substring. Swallow swaps out $fg and $bg the same way the Action option does (but if you use UseOld and NoClose, the app won't restart when FvwmButtons restarts, so it won't pick up any new colors you changed ๐).
Here's an example:
*FvwmButtons: (Swallow XClock 'Exec xclock -geometry -3000-3000 &')
This grabs the first window whose name, class or resource is "XClock" and shows it in the button. If there's no matching window, the "Exec" command makes one for you. The "-geometry -3000-3000" argument is there so the window gets drawn out of sight first, then swallowed into FvwmButtons ๐ซฃ.
You can also swallow modules by putting the module in place of 'Exec whatever':
*FvwmButtons: (Swallow "FvwmPager" "FvwmPager 0 0")
Here are the flags you can give swallow ๐ง:
NoClose/Closeโ Decides whether the swallowed program in this button gets un-swallowed or closed when FvwmButtons exits cleanly.NoClosecan be paired withUseOldso windows survive a window manager restart ๐ฆ. The default isClose.NoHints/Hintsโ Decides whether the swallowed program's hints get ignored. This is handy for forcing a window to resize itself to fit its button ๐. The default isHints.NoKill/Killโ Decides whether the swallowed program gets closed by killing it or by sending it a message. This helps when a program doesn't accept window manager protocol ๐. The default isNoKill. This does nothing ifNoCloseis specified.NoRespawn/Respawn/SwallowNewโ Decides whether the swallowed program gets respawned (restarted) if it dies. WithRespawn, it's restarted using the original command. Use this one with care ๐, since the program might have a legit reason to die. WithSwallowNew, the program isn't respawned, but if a new window with the specified name shows up, it gets swallowed ๐.NoOld/UseOldโ Decides whether the button tries to swallow an existing window matching thehangonname before spawning one withcommanditself ๐ฅ. Thehangonstring can use*wildcards to match any substring. The default isNoOld.UseOldcan be combined withNoKillso windows survive a window manager restart ๐. If you want FvwmButtons to swallow an old window and NOT spawn one if it fails, make the commandNop:NoTitle/UseTitleโ Decides whether the button's title comes from the swallowed window's title. WithUseTitle, the button title changes on the fly to match the window name โจ. The default isNoTitle.NoFvwmModule/FvwmModuleโ By default, FvwmButtons treats the swallowed window as an fvwm module window if the first 4 letters of the command areFvwmor the first 6 letters areModule.NoFvwmModuleandFvwmModuleoverride that logic ๐.
Some examples for the NoOld / UseOld flag:
*FvwmButtons: (Swallow (UseOld) "Console" Nop)
If you want to be able to start it yourself, combine it with an action:
*FvwmButtons: (Swallow (UseOld) "Console" Nop, \
Action `Exec "Console" console &`)
๐ท๏ธ Title [(options)] name
Sets the title written on the button ๐ธ. Quote it if you want whitespace in there. If a title is too long for its button at any point, characters get chopped off one at a time until it fits. If justify is Right, the head gets removed. Otherwise, the tail gets removed ๐
. These options work with Title:
Centerโ Centers the title horizontally. This is the default ๐ฏ.Leftโ Justifies the title to the left side ๐.Rightโ Justifies the title to the right side ๐.Sideโ Puts the title on the right hand side of any icon or swallowed window, instead of underneath, which is the default ๐ง. If you use small icons and combine this withLeftorRight, you can get a look similar to fvwm's menus ๐ญ.
๐ฑ๏ธ ActiveTitle name
The title written on the button while your mouse is hovering over it ๐ซถ. If you don't set an ActiveTitle, the text from Title shows up instead (if there is any).
๐ PressTitle name
The title written on the button while it's being pressed ๐ญ. If you don't set a PressTitle, the text from Title shows up instead (if there is any).
๐ฐ๏ธ Legacy fields [title icon command]
These fields are kept around for compatibility with older versions of FvwmButtons, and using them is discouraged ๐
. The title field works like the Title name option. If the title field is -, no title shows. The icon field works like the Icon filename option. If the icon field is -, no icon shows. The command field works like the Action command option, or like Swallow "hangon" command ๐.
๐ฌ The command
FvwmButtons recognizes any fvwm command. See fvwm(1) for more info ๐.
The Exec command gets a little extension when it's used in Actions. Its syntax is:
Exec ["hangon"] command
Example:
*FvwmButtons: (Action Exec "xload" xload)
The hangon string has to be wrapped in double quotes ๐. When FvwmButtons spots an Exec command like this, the button stays pushed in until a window whose name, class or resource matches the quoted part shows up. It's basically visual feedback so the user knows the action they asked for is actually happening โจ. The hangon string can use * wildcards to match any substring. If the quoted part is empty, the button pops out right away. Heads up though: users can keep pressing the button and re-running the command, even when it looks pressed in ๐.
๐ฌ Quoting
Any string with whitespace in it has to be quoted. Unlike earlier versions, commands don't need quotes anymore ๐ฅณ. If you do quote one, the quoting character gets passed on to the application untouched. Only commas , and closing parentheses ) have to be quoted inside a command.
You can quote with any of the three quotation characters. Single quote:
'This is a "quote"',
Double quote:
"It's another `quote'",
And back quote:
`This is a strange quote`.
Back quoting is a bit unusual, but it's used on purpose. If you run a preprocessor like FvwmCpp and want it to get into your commands, it looks like this:
#define BG gray60
*FvwmButtons: (Swallow "xload" `Exec xload -bg BG &`)
Any single character can be quoted with a backslash \ in front of it ๐ฆ.
โจ CREATING PANELS โจ
okay so bestie, heads up ๐ญ former versions of FvwmButtons (fvwm 2.0.46 to 2.3.6) handled panels in a totally different way. You can not use your old panel configuration with the new panel feature, so don't even try ๐ . Read "CONVERTING OLD PANEL CONFIGURATIONS" for the full tea โ.
๐ HOW TO CREATE NEW PANELS ๐
Any program that can be launched from within fvwm and that has a window can be used as a panel ๐ฆ. A terminal window could be your panel, or some application like xload or xosview, or another fvwm module, including FvwmButtons itself ๐. Literally all you need to know is how to start your application from fvwm ๐ .
The button that invokes the panel is just as easy to configure as any other button ๐. Honestly you only need the Panel option:
*FvwmButtons: (Panel my_first_panel \
"Module FvwmButtons -g -30000-30000 my_first_panel")
*FvwmButtons: (Panel my_second_panel \
"Exec exec xterm -g -30000-30000 -n my_second_panel")
This works like the Swallow option, but the big difference is that the application doesn't get shoved into the button when it starts up. Instead it's hidden from view ๐, and when you press the button, the window slides into view โจ. The -g -30000-30000 option tells the application to create itself somewhere very far to the top and left of your visible screen ๐ง. Otherwise you'd see it flash for a moment when FvwmButtons starts up ๐ญ. Some applications don't vibe with this kind of syntax, so you might have to live with the short flash ๐. If you want to make a panel from another instance of FvwmButtons, you totally can, but you have to give it a different name (my_first_panel in the example above) ๐ซถ.
๐ Warning, bestie: if you run FvwmButtons under the same name, new panels are created recursively until your system runs out of resources and FvwmButtons crashes! Don't do it ๐ญ.
To configure a second button bar with a different name, simply put *new_name in place of *FvwmButtons in your configuration file ๐ธ. If you're not familiar with the Swallow option, or you want to learn more about how 'swallowing' panels works, check out the description of the Swallow option ๐.
Now that your panel basically works, you'll want to tune it a bit โจ. You might not want a window title on the panel, and you can get rid of it with the fvwm Style command ๐
. If your button bar is sticky, you may want the panel to be sticky too ๐ซถ. And the panel window should probably have no icon in case it gets iconified ๐.
Style name_of_panel_window NoTitle, Sitcky, NoIcon
You might want your panel to stay open only until you select something in it ๐. You can give FvwmButtons the -transientpanel option after the -g option in the command. FvwmPager has a similar option, -transient ๐.
Last but not least ๐, you can now put an icon, a title, or a small arrow in the button so you can see what it's for. A title or icon can be specified as usual. To activate the arrow, just add (indicator) after the Panel keyword in the example above, and use the Padding option to leave a few pixels between the arrow and the border of the button. You can also give an optional direction the panel opens in ๐:
*FvwmButtons: (Padding 2, Panel(down, indicator) my_first_panel \
"Module FvwmButtons -g -30000-30000 -transientpanel my_first_panel")
There are several more options to configure how your panel works, for example the speed and smoothness of the sliding animation ๐ฆ. Check the description of the Panel option for all the details ๐.
๐งฉ CONVERTING OLD PANEL CONFIGURATIONS ๐งฉ
This section describes how to convert a pretty old syntax used in 2.2.x versions ๐ฐ๏ธ. You can skip it if your syntax is more recent ๐ .
With the old panel feature, you first had one or more lines defining panels in your main FvwmButtons configuration:
...
*FvwmButtons(Title WinOps,Panel WinOps)
*FvwmButtons(Title Tools ,Panel Tools)
...
After the last configuration line for the main panel, the configuration of the first panel followed, introduced with a line beginning with *FvwmButtonsPanel:
*FvwmButtonsPanel WinOps
*FvwmButtonsBack bisque2
...
*FvwmButtonsPanel Tools
*FvwmButtonsBack bisque2
...
And perhaps you had style commands for your panels:
Style FvwmButtonsPanel Title, NoHandles, BorderWidth 0
Style FvwmButtonsPanel NoButton 2, NoButton 4, Sticky
The new configuration looks much the same, but now the configuration of the main panel is independent of the configuration of the sub panels ๐ซถ. The lines invoking the panels use the same syntax as the Swallow option, so you simply add the name of the window to use as a panel, plus the command to execute, instead of the panel name. Note that you give the new instance of FvwmButtons a different name ๐.
*FvwmButtons: (Title WinOps, Panel WinOps \
"Module FvwmButtons WinOps")
*FvwmButtons: (Title Tools , Panel Tools \
"Module FvwmButtons Tools")
If you used something like Panel-d, you now have to use Panel(down) instead ๐. To make the new panel vanish as soon as a button was selected, start FvwmButtons with the -transientpanel option:
*FvwmButtons: (Title Tools , Panel(down) Tools \
"Module FvwmButtons -transientpanel Tools")
The rest of the configuration is very easy to change ๐. Delete the lines *FvwmButtonsPanel <name> and add <name> to all of the following configuration lines for the panel instead. Use the same name in your Style commands too:
*WinOps: Back bisque2
...
*Tools: Back bisque2
...
Style "WinOps" Title, NoHandles, BorderWidth 0
Style "WinOps" NoButton 2, NoButton 4, Sticky
Style "Tools" Title, NoHandles, BorderWidth 0
Style "Tools" NoButton 2, NoButton 4, Sticky
That's it, bestie ๐ฅณ. The new panels are much more flexible. Please refer to other parts of this documentation for details.
๐ค WHY WAS THE PANEL FEATURE REWRITTEN? ๐ค
There are several reasons ๐ง. The most important one is that the program code implementing the panels was very disruptive and caused a lot of problems ๐. At the same time, it made writing new features for FvwmButtons difficult at best. The second reason is that most users were simply unable to make it work, because it was way too complicated ๐ญ. Even I (the author of the new code) had to spend several hours before I got it working the first time ๐. The third reason is that the new panels are more versatile: any application can be a panel in FvwmButtons, not just other instances of FvwmButtons itself ๐. So I sincerely hope nobody is angry about the change ๐ฅบ๐ซถ. Yes, you have to change your configuration, but the new feature is much easier to configure, especially if you already know how the Swallow option works ๐
โจ.
โจ ARRANGEMENT ALGORITHM โจ
okay so FvwmButtons is literally the queen of lining things up ๐ it figures out where every button goes by running the same little algorithm recursively on each container, including the buttonbox itself ๐ซถ fr fr it's giving organized
๐งฎ Getting the size right
First it works out how many button unit areas it's gonna need ๐ it adds up the width times the height (in buttons) of every button. Containers count as a normal button for now, ngl. Then it looks at the rows and columns arguments ๐
- if
rowsis given, it works out how many columns it needs and sticks to that, unlesscolumnsis bigger, in which case you get some empty space at the bottom of the buttonbox ๐ธ - if
columnsis given, it calculates how many rows it needs to fit all the buttons ๐ง - if neither is given, it assumes you want two rows and finds the number of columns from that ๐
If the BoxSize option is set to smart, at least the height/width of the tallest/widest button is used. The fixed value prevents the box from getting resized if both rows and columns have been set to non-zero ๐
๐งฉ Shuffling buttons
Now it has a big enough area to place the buttons in, so all that's left is placing them right ๐ there are two kinds of buttons: fixed and floating ๐ฆ A fixed button is forced into a specific slot by an x/y geometry argument. All other buttons are considered floating.
Fixed buttons get placed first. Should a fixed button overlap another one, or be placed outside the buttons window, FvwmButtons exits with an error message ๐ After that the floating buttons get placed. The algorithm tries to place them in a left to right, top to bottom western fashion ๐ If a button fits at the suggested position, it's placed there. If not, the current slot stays empty and the slot to the right gets considered. After a button is placed, the next button tries the next slot, and so on until every button is placed โจ
Additional rows get added below the bottom line of buttons until all buttons are placed, if necessary, when the BoxSize option smart is used ๐
๐ช Containers
Containers are arranged by the same algorithm. They're basically shuffled recursively as the algorithm finds them ๐ซง
๐ Clarifying example
An example might be useful here ๐ Suppose you have 6 buttons, all unit sized except number two, which is 2x2. This makes for 5 times 1 plus 1 times 4 equals 9 unit buttons total area. Assume you have requested 3 columns.
1) +---+---+---+ 2) +---+---+---+ 3) +---+---+---+
| 1 | | | 1 | | | 1 | |
+---+ + +---+ 2 + +---+ 2 +
| | | | | | 3 | |
+ + + +---+---+ +---+---+---+
| | | | | | | |
+-----------+ +---+-------+ +---+---+---+
4) +---+---+---+ 5) +---+-------+ 6) +---+-------+
| 1 | | | 1 | | | 1 | |
+---+ 2 + +---+ 2 | +---+ 2 |
| 3 | | | 3 | | | 3 | |
+---+---+---+ +---+---+---+ +---+-------+
| 4 | | | 4 | 5 | | | 4 | 5 | 6 |
+---+---+---+ +---+---+---+ +---+---+---+
๐ What size will the buttons be?
When FvwmButtons has read the icons and fonts that its configuration needs, it can find out what size every non-swallowing button needs ๐ The unit button size of a container is set to be large enough to hold the largest button in it without squeezing it. Swallowed windows are simply expected to be comfy with the button size they get from this scheme ๐ฆ
If a particular configuration needs more space for a swallowed window, it can be set in that button's configuration line using the option "Size width height". This tells FvwmButtons to give that button at least width by height pixels inside the relief and padding ๐
โจ DYNAMICAL ACTIONS โจ
A running FvwmButtons instance can receive some commands at run time ๐ง This is achieved using the fvwm command:
SendToModule FvwmButtons-Alias <action> <params>
๐ฏ Supported actions
ChangeButton button_id optionsโ this one lets you swap the title or icon of a button while fvwm is running ๐button_idis the id of the button to change, as set with theIdbutton option. It can also be a number, in which case the button with that number is assumed. And finally,button_idmay be in the form+x+y, wherexandyare the column number and row number of the button you want to change ๐งฉ You can set several option pairs (name with value) by delimiting them with a comma. Currently the options includeTitle,ActiveTitle,PressTitle,Colorset,Icon,ActiveIconandPressIcon๐ They work just like the configuration options with the same names.ExpandButtonVars button_id commandโ replaces variables in the command exactly like theActionbutton option does, then sends the command back to fvwm ๐button_iduses the same syntax as described underChangeButtonabove.PressButton button_id [mouse_button]โ simulates a mouse click on a button ๐ฑ๏ธbutton_idis the id of the button to press, as set with theIdbutton option.mouse_buttonis the number of the mouse button used to click on the button, e.g."1"for the left mouse button etc. Quotes around the number aren't necessary ๐ If themouse_buttonoption is omitted, mouse button1is assumed. This behaves exactly as if the mouse button was pressed and released on the button in question ๐Silentโ this prefix may be specified before other actions ๐คซ It disables all possible error and warning messages ๐
๐ธ Example
Example:
*FvwmButtons: (Id note1, Title "13:30 - Dinner", Icon clock1.xpm)
SendToModule FvwmButtons Silent \
ChangeButton note1 Icon clock2.xpm, Title "18:00 - Go Home"
โจ SAMPLE CONFIGURATION โจ
Okay bestie, here's a juicy peek at some .fvwm2rc excerpts that set up FvwmButtons's initialization commands ๐
##########################################################
# Load any modules which should be started during fvwm
# initialization
# Make sure FvwmButtons is always there.
AddToFunc StartFunction "I" Module FvwmButtons
# Make it titlebar-less, sticky, and give it an icon
Style "FvwmButtons" Icon toolbox.xpm, NoTitle, Sticky
# Make the menu/panel look like CDE
Style "WinOps" Title, NoHandles, BorderWidth 0
Style "WinOps" NoButton 2, NoButton 4, Sticky
Style "Tools" Title, NoHandles, BorderWidth 0
Style "Tools" NoButton 2, NoButton 4, Sticky
##########################################################
DestroyModuleConfig FvwmButtons: *
*FvwmButtons: Fore Black
*FvwmButtons: Back rgb:90/80/90
*FvwmButtons: Geometry -135-5
*FvwmButtons: Rows 1
*FvwmButtons: BoxSize smart
*FvwmButtons: Font -*-helvetica-medium-r-*-*-12-*
*FvwmButtons: Padding 2 2
*FvwmButtons: (Title WinOps, Panel WinOps \
"Module FvwmButtons -transientpanel WinOps")
*FvwmButtons: (Title Tools, Panel Tools \
"Module FvwmButtons -transientpanel Tools")
*FvwmButtons: (Title Resize, Icon resize.xpm, Action Resize)
*FvwmButtons: (Title Move, Icon arrows2.xpm, Action Move )
*FvwmButtons: (Title Lower, Icon Down, Action Lower )
*FvwmButtons: (Title Raise, Icon Up, Action Raise )
*FvwmButtons: (Title Kill, Icon bomb.xpm, Action Destroy)
*FvwmButtons: (1x1,Container(Rows 3,Frame 1))
*FvwmButtons: (Title Dopey ,Action \
`Exec "big_win" xterm -T big_win -geometry 80x50 &`)
*FvwmButtons: (Title Snoopy, Font fixed, Action \
`Exec "small_win" xterm -T small_win &`)
*FvwmButtons: (Title Smokin')
*FvwmButtons: (End)
*FvwmButtons: (Title Xcalc, Icon rcalc.xpm, \
Action `Exec "Calculator" xcalc &`)
*FvwmButtons: (Title XMag, Icon magnifying_glass2.xpm, \
Action `Exec "xmag" xmag &`)
*FvwmButtons: (Title Mail, Icon mail2.xpm, \
Action `Exec "xmh" xmh &`)
*FvwmButtons: (4x1, Swallow "FvwmPager" `FvwmPager 0 3` \
Frame 3)
*FvwmButtons: (Swallow(UseOld,NoKill) "xload15" `Exec xload \
-title xload15 -nolabel -bg rgb:90/80/90 -update 15 \
-geometry -3000-3000 &`)
Okay so the last lines are a little tricky ๐ One spawns an FvwmPager module and captures it so it can display in a quadruple width button. When the frame is used, the Pager will be as big as possible within the button's relief ๐ธ
The final line is even more magic โจ Check out the combo of UseOld and NoKill! It'll try to swallow an existing window named "xload15" on startup (if that fails, it starts one with the specified command instead). That swallowed app gets un-swallowed when FvwmButtons ends. And it's launched with -geometry -3000-3000 so it stays hidden until it's swallowed, iykyk ๐ซฃ
The other panels get specified after the root panel:
########## PANEL WinOps
DestroyModuleConfig WinOps: *
*WinOps: Back bisque2
*WinOps: Geometry -3-3
*WinOps: Columns 1
*WinOps: (Title Resize, Icon resize.xpm, Action Resize)
*WinOps: (Title Move, Icon arrows2.xpm, Action Move )
*WinOps: (Title Lower, Icon Down, Action Lower )
*WinOps: (Title Raise, Icon Up, Action Raise )
########## PANEL Tools
DestroyModuleConfig Tools: *
*Tools: Back bisque2
*Tools: Geometry -1-1
*Tools: Columns 1
*Tools: (Title Kill, Icon bomb.xpm, Action Destroy)
The color spec rgb:90/80/90 is actually the most correct way to specify independent colors in X, so use it instead of the older #908090 ๐จ If you do use the hash version in your config, you need to escape the hash in any command that gets executed, or fvwm will think the rest of the line is a comment and ghost your command ๐ป
Note that with the x/y geometry specs you can build button windows with gaps, which is so cute. Here's another example. You literally cannot pull this off without geometry specs for the buttons ๐
##########################################################
# Another example
##########################################################
# Make it titlebar-less, sticky, and give it an icon
Style "FvwmButtons" Icon toolbox.xpm, NoTitle, Sticky
DestroyModuleConfig FvwmButtons: *
*FvwmButtons: Font 5x7
*FvwmButtons: Back rgb:90/80/90
*FvwmButtons: Fore black
*FvwmButtons: Frame 1
# 9x11 pixels per button, 4x4 pixels for the frame
*FvwmButtons: Geometry 580x59+0-0
*FvwmButtons: Rows 5
*FvwmButtons: Columns 64
*FvwmButtons: BoxSize fixed
*FvwmButtons: Padding 1 1
# Pop up a module menu directly above the button.
*FvwmButtons: (9x1+3+0, Padding 0, Title "Modules", \
Action `Menu Modulepopup rectangle \
$widthx$height+$lleft+$top o+50 -100m`)
# first row of buttons from left to right:
*FvwmButtons: (3x2+0+1, Icon my_lock.xpm, Action `Exec xlock`)
*FvwmButtons: (3x2+3+1, Icon my_recapture.xpm, Action Recapture)
*FvwmButtons: (3x2+6+1, Icon my_resize.xpm, Action Resize)
*FvwmButtons: (3x2+9+1, Icon my_move.xpm, Action Move)
*FvwmButtons: (3x2+12+1, Icon my_fvwmconsole.xpm, \
Action 'Module FvwmConsole')
# second row of buttons from left to right:
*FvwmButtons: (3x2+0+3, Icon my_exit.xpm, Action QuitSave)
*FvwmButtons: (3x2+3+3, Icon my_restart.xpm, Action Restart)
*FvwmButtons: (3x2+6+3, Icon my_kill.xpm, Action Destroy)
*FvwmButtons: (3x2+9+3, Icon my_shell.xpm, Action 'Exec rxvt')
# big items
*FvwmButtons: (10x5, Swallow (NoKill, NoCLose) \
"FvwmPager" 'FvwmPager * * -geometry 40x40-1024-1024')
*FvwmButtons: (6x5, Swallow "FvwmXclock" `Exec xclock \
-name FvwmXclock -geometry 40x40+0-3000 -padding 1 \
-analog -chime -bg rgb:90/80/90`)
*FvwmButtons: (13x5, Swallow (NoClose) \
"FvwmIconMan" 'Module FvwmIconMan')
*FvwmButtons: (20x5, Padding 0, Swallow "xosview" \
`Exec /usr/X11R6/bin/xosview -cpu -int -page -net \
-geometry 100x50+0-3000 -font 5x7`)
๐ BUGS ๐
The action part of the Swallow option must be quoted if it contains any whitespace character. Don't skip this, bestie, or it's giving chaos ๐ญ
๐ COPYRIGHTS ๐
The FvwmButtons program, and the concept for interfacing this module to the Window Manager, are all original work by Robert Nation ๐
Copyright 1993, Robert Nation. No guarantees, warranties, or anything else are provided or implied in any way whatsoever. Use this program at your own risk. Permission to use this program for any purpose is given, as long as the copyright is kept intact.
Further modifications and patching by Jarl Totland, copyright 1996. The statement above still applies ๐
๐ AUTHOR ๐
Robert Nation, with some enhancements from Jarl Totland, Jui-Hsuan Joshua Feng, and Scott Smedley. Legends only ๐ซถ
Okay that's the whole tea, bestie! โจ This page is from the 3rd Berkeley Distribution, version 2.7.0, dated 19 October 2022. Now go make your FvwmButtons slay ๐ ๐ฆ
๐ฆ where this page comes from
- alpine 3.24: fvwm-doc 2.7.0-r3 ยท GPL-2.0-or-later
- fedora 43: fvwm 2.7.0-15.fc43 ยท GPL-2.0-or-later
- fedora 44: fvwm 2.7.0-16.fc44 ยท GPL-2.0-or-later
- nixos 26.05: fvwm 2.7.0
- nixpkgs unstable: fvwm 2.7.0
- opensuse-leap 16.0: fvwm2 2.7.0-bp160.1.11 ยท GPL-2.0-or-later
- opensuse-leap 16.0: fvwm2 2.7.0-bp160.1.11 ยท GPL-2.0-or-later
- opensuse-leap 16.0: fvwm2 2.7.0-bp160.1.11 ยท GPL-2.0-or-later
- opensuse-leap 16.0: fvwm2 2.7.0-bp160.1.11 ยท GPL-2.0-or-later
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms