| Home ⋅ All Commands ⋅ Grouped Commands ⋅ Modules ⋅ FAQ |

# FvwmTabs

###

## 1. Name

FvwmTabs is a generic tabbing module for the fvwm window manager.

## 2. Synopsis

FvwmTabs is spawned by fvwm, so no command line invocation is possible.

## 3. Description

The FvwmTabs module is capable of swallowing any fvwm window & treating it as a tab in a tab-manager window. A tab-manager is sometimes called a tabber. Each tab-manager can store any number of windows, each in its own tab. The number of tab-managers is limited only by system resources. Tab-managers can even be nested/swallowed within other tab-managers. (ie. a tab-manager can be added as an individual tab to another tab-manager.)

Here is a screenshot of an FvwmTabs tab-manager with an rxvt window selected. Note the buttons at the top which allow switching between applications.

## 4. Invocation

FvwmTabs can be invoked by inserting the line:

    Module FvwmTabs

in your .fvwmrc file. This can be placed on a line by itself, if FvwmTabs is to be spawned during fvwm's initialization, or can be bound to a menu, mouse button or keystroke to invoke it later.

## 5. Installing Dependencies

FvwmTabs requires 2 CPAN modules (that are NOT distributed with fvwm) to be installed on your system. They are Tk and X11::Protocol.

They are available at: http://search.cpan.org/CPAN/authors/id/N/NI/NI-S/Tk-804.027.tar.gz and http://search.cpan.org/~smccam/X11-Protocol-0.56/.

To install either package:

    tar zxvf $name.tar.gz ; cd $name ; perl Makefile.PL ; make install

FvwmTabs will tell you if you do not have these packages installed when you (try to) start it.

## 6. Configuration Options

FvwmTabs reads the same config file as fvwm when it starts up.

The following options are recognised by FvwmTabs:

*FvwmTabs: activeFG color
  The text color of the button for the visible tab. The default color is yellow.
*FvwmTabs: activeBG color
  The backgound color of the button for the visible tab. The default color is MidnightBlue.
*FvwmTabs: inactiveFG color
  The text color of the buttons for the invisible tabs. The default color is antiquewhite.
*FvwmTabs: inactiveBG color
  The backgound color of the buttons for the invisible tabs. The default color is royalblue.
*FvwmTabs: activeRelief style
  The relief style to use for active buttons. style can be either raised, flat or sunken. The default style is sunken.
*FvwmTabs: inactiveRelief style
  The relief style to use for inactive buttons. style can be either raised, flat or sunken. The default style is flat.
*FvwmTabs: buttonYPadding pixels
  How much padding to use around top and bottom of tab buttons. The default value is 3 pixels.
*FvwmTabs: pollRate ms
  Specifies how often to check for X events. ms is time in milliseconds. The default value, 250, should be fine for most users. If you are on a very slow machine you may wish to increase this.
*FvwmTabs: buttonFont font
  The font to use on the tab buttons. The default font is Helvetica -12 bold.
*FvwmTabs: titleFont font
  The font to use on the titlebar. The default font is Helvetica -12.
*FvwmTabs: menuFont font
  The font to use on the menus. The default font is Helvetica -12.
*FvwmTabs: fontSelector fontProgram
  The external font chooser program to launch when dynamically changing fonts. The default fontProgram is gfontsel --print -f "%f". Anti-gnome users might try xfontsel -print -pattern "%f". If set to none, no font menu options will appear.
*FvwmTabs: autoSwallowClass className [tabManagerId], ...
*FvwmTabs: autoSwallowResource resourceName [tabManagerId], ...
*FvwmTabs: autoSwallowName name [tabManagerId], ...
  Specify windows to swallow automatically. These are comma-separated lists that specify the class/resource/name of a window and an optional tab-manager id into which the window should be swallowed. By default, the tab-manager id increments from zero - ie. 0 is the first tab-manager created, 1 the second, etc, but it may be overriden by specifying an argument to the NewTabber function. (No whitespace is allowed in tabber ids.) You can alternatively specify 'any' or 'lastFocus' which will put the window in the tab-manager with the least number of tabs or the last focused tab-manager, respectively. If no tab-manager number is specified, an implicit default value of 'any' is used. Note that className/resourceName/name can be a (Perl) regular expression.
*FvwmTabs: balloonBG color
  The backgound color of the balloon popups that appear over the tab buttons. The default color is #C0C080.
*FvwmTabs: balloonFont font
  The font to use on the balloon popups. The default font is Helvetica -12.
*FvwmTabs: balloonWait ms
  How long the mouse cursor must pause (in milliseconds) over a tab button before the balloon pops up. The default value is 250.
*FvwmTabs: balloonMsg msg
  Message to display in balloon popups. The default value is %tabNo:\n%iconText\n%title.
*FvwmTabs: autoResize bool
  bool can be either true or false. If true, windows in the tab-manager automatically resize to the dimensions of the largest window in the tab-manager. The default value is false. If the user performs an explicit resize of a tab-manager window, all windows in the tab-manager are resized to the new window size.
*FvwmTabs: stateFile file
  FvwmTabs has the ability to preserve its state (ie. remember the windows it has swallowed as tabs) b/w fvwm restarts. file specifies the name of a temporary file to record the state in, so it can be reconstructed when FvwmTabs restarts. The default file is `$FVWM_USERDIR`/.fvwmtabs.state.
*FvwmTabs: fixedSizeTabs bool
  bool can be either true or false. If true, the tab-manager will ensure each tab-button has the same dimensions. If false, the selected tab is expanded so that it is fully visible. The default value is false.
*FvwmTabs: showTitlebar bool
  Show internal titlebar. If set to true a titlebar appears below the row of tab-buttons and displays the title associated with the current window. This titlebar is capable of displaying long or multi-line titles. The default value is true.
*FvwmTabs: useTMTitlebar bool
  Add the title associated with the selected tab to the tab-manager titlebar. (ie. the titlebar at the top of the window, distinct from the titlebar below the tab-buttons.) Default value is true.
*FvwmTabs: dragDropIcon imageFile
  Specify the icon to display when performing a drag-&-drop operation to reorder the tab-buttons. FvwmTabs will search the ImagePath for this image unless an absolute filename (ie. filename begins with '/') is specified. The default value is none. If none (or an invalid file) is specified a * is used.
*FvwmTabs: bBuggyFocus bool
  FvwmTabs tries to work around a limitation in Perl/Tk (there is no way to access the timestamp associated with WM_TAKE_FOCUS events). On some systems this doesn't work and sometimes tab-managers have trouble acquiring the focus. If this happens to you, try setting this option to true. This can lead to focussing race-conditions (tab-managers temporarily "steal" focus in some situations) but this is less annoying than not being able to focus at all.
*FvwmTabs: enableSwallowDND bool

  Swallow windows that (are moved to) overlap a tabber.

  Note: drag-&-drop can be enabled for individual tabbers via the menu. The default value is true.

*FvwmTabs: swallowDNDTolerance tol
  Determines how much a window must overlap a tabber for it to be swallowed when drag-&-drop is enabled. If the value has a %-sign appended to it, windows must overlap by the specified percentage of the current size of the tabber. If no %-sign is present, the value is treated in units of pixels. The default value is 10 (pixels).
*FvwmTabs: useIconsOnTabs bool
  Show the mini icon associated with each window on its tab button. Note: mini icons for apps that use EWMH icons look a bit distorted. This is because of the poor image resizing algorithm used in Tk. This sinactiveBG hould be rectified in the near future. The default value is true.
*FvwmTabs: killIcon image
  Image to use on kill toolbar button. Default is none.
*FvwmTabs: addIcon image
  Image to use on add toolbar button. Default is none.
*FvwmTabs: swallowIcon image
  Image to use on add toolbar button when tabber will swallow next window to popup. Default is none. By using a separate icon to addIcon, this option provides visual feedback on when a tabber will unconditionally swallow the next window to popup.
*FvwmTabs: releaseIcon image
  Image to use on release toolbar button. Default is none.
*FvwmTabs: menuIcon image
  Image to use on menu toolbar button. Default is none.

### 6.1. Additional Configuration

Images you may wish to use with the FvwmTabs module:

If you use a decent shell like zsh, you might like to add these functions to your ~/.zshrc file so that tabs/titles have more meaningful names when executing commands:

    setTitleAndIcon () {  print -nP '%{\e]2;'$1'\a\e]1;'$2'\a%}' }
    preexec () { setTitleAndIcon $1 ${1%% *} }
    precmd () { setTitleAndIcon %n@%m %m }

There are likely similar functions for other sh/csh shells.

## 7. Functions for Bindings

A number of fvwm functions are available once the FvwmTabs module is started.

NewTabber

  Create a new tabber. Optional argument is tabber name. No whitespace is allowed in the tabber name. Can also prefix --geometry argument. Example:

      NewTabber --geometry=+200+400 scottie

Tabize
  Add a window (as a tab) to a tabber.
NextTab
  Show/select the next tab.
PrevTab
  Show/select the previous tab.
LastTab
  Show/select the last selected tab (if there was one).
ReleaseTab
  Release a tabbed window back to fvwm.
ReleaseIconifyTab
  Release a tabbed window back to fvwm & iconify it.
ReleaseAllTabs
  Release all windows in a tab-manager back to fvwm.
ReleaseIconifyAllTabs
  Release all windows in a tab-manager back to fvwm & iconify them.
CloseTabber
  Destroy a tab-manager. All windows in the tab-manager are released back to fvwm.
AddTab
  Pick a new window to add to a tab-manager. Selecting this option & clicking on a window will add the selected window to the tab-manager.
MultiAddTab
  Pick & add new windows to a tab-manager until ESC is pressed.
ShowTab tabNo
  Show/select tab tabNo in the tab-manager. tabNo is zero-based. ie. 0 is the first tab, 1 is the second, etc.
AddToTabber
  Add a window (as a tab) to a tab-manager.
SwapLeft
  Swap the selected window with the window on its immediate left.
SwapRight
  Swap the selected window with the window on its immediate right.
SelectTabber
  Select a tab-manager for a new window to be added to.
EnableDND
  Swallow windows that (are moved to) overlap a tabber.

## 8. Key Bindings

By default, FvwmTabs reads a default user configuration file `FvwmTabs-DefaultSetup` which defines several useful key-bindings for FvwmTabs. You can tell FvwmTabs NOT to read this file with:

    SetEnv FvwmTabs_NoDefaultSetup

This environment variable must be set before starting the module.

Then, pressing Ctrl-Alt-a (when the focus is in a tab-manager) will allow you to click on a window to add to the tab-manager.

All of the key bindings can be changed using the standard fvwm Key command and making use of the aforementioned fvwm functions. ie.

    Key (FvwmTabs*) A A CM Function AddTab

Then, pressing Ctrl-Alt-a (when the focus is in a tab-manager) will allow you to click on a window to add to the tab-manager.

The default key bindings (set in the `FvwmTabs-DefaultSetup` file) are:

Ctrl-Alt-a
  AddTab
Ctrl-Alt-c
  CloseTabber
Ctrl-Alt-i
  ReleaseIconifyTab
Ctrl-Alt-Shift-I
  ReleaseIconifyAllTabs
Ctrl-Alt-l
  LastTab
Ctrl-Alt-m
  MultiAddTab
Ctrl-Alt-n & Ctrl-Alt-Tab
  NextTab
Ctrl-Alt-p
  PrevTab
Ctrl-Alt-r
  ReleaseTab
Ctrl-Alt-Shift-R
  ReleaseAllTabs
Ctrl-Alt-t
  NewTabber
Ctrl-Alt-<num>
  ShowTab <num>
Ctrl-Alt-Left
  SwapLeft
Ctrl-Alt-Right
  SwapRight

## 9. Mouse Bindings

### 9.1. Mouse Bindings on Tab Buttons

Mouse Button | Action
--- | ---
1 | display the window associated with the tab.
2 | release the window associated with the tab back to the window manager as a standalone window.
Ctrl + 2 | tab-buttons can be reordered with a drag-&-drop operation initiated by holding down the Ctrl key and dragging with Mouse-2. A dragged tab is inserted before the tab-button onto which it is dropped.
3 | release the window associated with the tab back to the window manager as a standalone window.

### 9.2. Mouse Bindings on Toolbar Icons

There are 4 toolbar icons named (L-to-R): menu, release, add and kill.

Icon | Mouse Button | Action
--- | --- | ---
menu | 1 | Display main menu. See menu.
release | 1 | release the selected window from the tabber.
release | 2 | release all windows from the tabber, and iconify them.
release | 3 | will release all windows from the tabber.
add | 1 | add the next window you click on to the tabber.
add | 2 | add the next window to popup to the tabber.
add | 3 | add every window you click on (until you press Esc) to the tabber.
kill | 1 | Close the selected window.
kill | 2 | causes FvwmTabs to try to kill the selected window itself.
kill | 3 | Destroy the selected window.

## 10. Menu Options

Mouse-1 on the "menu" button will bring up a menu of options:

Menu option | Description
--- | ---
Release All | release all tabbed programs back to the window manager as standalone windows.
Release All (Iconify) | release all tabbed programs back to the window manager as iconised standalone windows.
Add | add the next mouse-clicked window to the tab-manager.
Add Next | add the next window that is created to the tab-manager.
Multi Add | keep adding mouse-clicked windows to a tab-manager until the escape key is pressed. Useful for adding multiple windows to a tab-manager at once.
Font | shows a sub-menu enabling you to dynamically configure the button/title/menu fonts, using the external program identified by the fontSelector option.
Options | shows a sub-menu with the following items: Show Internal Titlebar toggle the display of the titlebar below the tab-buttons. Use Main Titlebar set the titlebar of the FvwmTabs window to the title of the selected tab. Auto Resize Automatically resize all windows to the dimensions of the largest window in the tab-manager.. Swallow Overlapping (D&D) toggle the swallowing of overlapping windows.
Window Tabizer Dialog | popup a dialog box for specifying windows to swallow. Windows can be specified explicitly (by name) or by using a (Perl) regular expression matcher. (Note: / character is automatically escaped.)
window | The menu options between the seperators will display the window/tab associated with the text. (The menu text is actually the title associated with the window. The text on each tab-button is the icon name.)
About | pops up a dialog with version/developer information.
Close | close the FvwmTabs window, invoking Release All in the process.

## 11. Tutorial

### 11.1. Creating a tabber

If the FvwmTabs module is correctly installed/configured, press Ctrl-Alt-t and a little window that looks something like this should appear:

A new tabber is created every time Ctrl-Alt-t is pressed.

### 11.2. Adding windows to a tabber

There are a number of ways to add windows to a tabber:

- To add a single window to a tabber, click the add (orange) icon (or press Ctrl-Alt-a when the tabber is focussed). The mouse cursor will change to a crosshair. The next window selected (clicked on) will be swallowed by the tabber. To cancel an add-window operation, press Esc.
- To add multiple windows to a tabber, click the add (orange) icon with the right mouse button (or press Ctrl-Alt-m when the tabber is focussed). All windows that are selected (clicked on) until Esc is pressed, will be swallowed by the tabber.
- Invoke the tab.zsh script from a shell to swallow the next window that pops up. For example:

  tab.zsh xterm -bg blue -fg white tab.zsh gnome-calculator

  The xterm and calculator window will automatically be swallowed into the tabber that last had the focus.
- Invoke the fvwm SwallowNew function. Syntax is:

      Function SwallowNew tabberId fvwmCommand

  For example:

      Function SwallowNew any Function StartupBrowser
      Function SwallowNew lastFocus Exec exec rxvt
      Function SwallowNew 2 Exec exec gvim header.hh

  The fvwm command is executed when the tabber is ready to swallow the next window that is created.

### 11.3. Releasing windows from a tabber

There are a number of ways to release windows from a tabber.

To release a single window from a tabber:

- Click the release (middle green) icon with the left mouse button.
- Press Ctrl-Alt-r when the tabber is focussed.
- Click the tab button for the window with the middle mouse button.
- To release and iconify a window, click the tab button for the window with the right mouse button.

The first two release the selected window. The last two release the window the tab button is associated with.

To release all windows from a tabber:

- Click the release (left green) icon with the middle mouse button.
- To release and iconify all windows, click the release (left green) icon with the right mouse button.

## 12. Known Bugs

Tab-managers don't take focus when iconified.

FvwmTabs doesn't obey ClickToFocus mode.

FvwmTabs has a problem swallowing shaded windows.

Using Maximize to resize tab-manager windows prevents dynamic resizing from working.

Please send bug reports, feature requests and queries about FvwmTabs to the fvwm mailing list: `<fvwm@fvwm.org>`. Be sure to include the word "FvwmTabs" somewhere in the subject line.

## 13. Licence

FvwmTabs is GPL software.

## 14. Author

Scott Smedley `<ss@aao.gov.au>`

fvwm 2.6.6