Firebox
english français
Guide
  1. Getting started.
    1. Compiling.
    2. Running.
      1. Using the startx command.
      2. With a Display Manager.
  2. Configuration.
  3. Themes.
    1. Theme file header.
    2. Internal pictures.
      1. Desktop background.
      2. Arrows for menus.
    3. Size of items.
      1. Frame windows.
      2. Menus.
      3. Switch panels.
    4. Text related information.
      1. Font name.
      2. Alignment.
      3. Shadow position.
    5. Used colors.
    6. Pictures for titlebar buttons.
    7. Basic bricks for display.
      1. Common base.
      2. How works the machinery ?
      3. Window shapes.
      4. Rendering objects.
    8. Highlight border for windows.
    9. Client window body.
    10. Client handlers for resizing.
    11. Client and root menus.
      1. Menu board.
      2. Header entry.
      3. Common entries.
      4. Separator bar.
      5. Dynamic menu board.
    12. Switch panels.
      1. Window panel.
      2. Desktop panel.
      3. Desktop cells.
  4. Appendix.
    1. Default key bindings.
    2. XML validation schemas.

Getting started

1.1. Compiling

The following programs is what you will need to compile Firebox:

Once you have the above dependencies installed, you are ready to build Firebox. Untar the archive and from inside the source tree and run:

$ ./configure
$ make install

Building from the Subversion repository may be more difficult. Please read the FAQ about it.

1.2. Running

For most people, Firebox binary is located in /usr/local/bin/.

1.2.1. Using the startx command.

The uncut version is:

$ startx /usr/local/bin/firebox -- :3

... where 3 is the index of a free display.

To run Firebox by only running startx, you need to edit your $HOME/.xinitrc file. This is a shell script, so to run Firebox a typical content is:

# [...]

exec firebox

Then make sure the file has enough rights:

$ chmod 700 .xinitrc

1.2.2. With a Display Manager.

The best should be consulting the documentation for your specific Display Manager in order to add entries into it.

Alternately, you can edit a $HOME/.xsession file. This small file can be made identical to the .xinitrc example above. With this method, you would choose "default" as the login target in your display manager.

In this case no exec right is needed.


Configuration.

Please use the preferences editor.


Themes.

This part describes the XML structure of theme files.

Even if it is quite detailed, the best will always be to have a look at existing themes. That way allows to learn quickly tips and tricks !

For a safer (and faster) approach, one can follow the following steps:

  1. begin by reading the base, at least the 3.7.1 and 3.7.2 sections.
  2. analyse the small theme called "Learning theme for beginners" (see the download page).
  3. try to modify the more visual items.

The current theme is loaded from ~/.firebox/themes/current, which can be either a directory or a symbolic link. In all cases, it must contain a theme.xml file.

3.1. Theme file header.

The first section of a theme file is a header containing some information about the theme itself.

All its tags are located in:

<FireboxTheme>
    <Header>
    ...
    </Header>
</FireboxTheme>

The Header tag is composed of several tags which have only string values:

3.2. Internal pictures

3.2.1. Desktop background.

Firebox can deal either with screen savers or images for desktop backgrounds. As programs can't come with themes without difficulty, only pictures are supported here.

Theme background pictures are defined like this:

<FireboxTheme>
    <Background>
        <Picture>my_picture.png</Picture>
    </Background>
</FireboxTheme>

3.2.2. Arrows for menus.

There are three types of arrow for menus. They may be defined like that:

<FireboxTheme>
    <SystemPictures>
        <SubmenusArrow>my_picture1.png</SubmenusArrow>
        <DMenuLeftArrow>my_picture2.png</DMenuLeftArrow>
        <DMenuRightArrow>my_picture3.png</DMenuRightArrow>
    </SystemPictures>
</FireboxTheme>

3.3. Size of items.

The six main tags of this section are located in:

<FireboxTheme>
    <Sizes>
    ...
    </Sizes>
</FireboxTheme>

3.3.1. Frame windows.

The Borders tag defines how big the frame windows are ; it has four attributes:

frame size
  • east : right border of the frame window.
  • north : top border of the frame window, ie. height of the titlebar.
  • west : left border of the frame window.
  • south : bottom border of the frame window.

The TitleBar tag sets up information about titlebar icon and buttons ; thus, it also has four useful attributes:

frame size
  • padding : space between the border and the first icon/button.
  • sep : space between two titlebar buttons.
  • width : width of titlebar buttons.
  • height : height of titlebar buttons.

3.3.2. Menus.

The Menu tag is used to define the required height of menu items. If a size is not stated, then its default value is the height of the font with which the caption is printed (or 0 for the separator bar).

The final height of a menu entry is equal to :

MAX(user defined size, size required for printing) + 2 x vertical padding (see below).

The Gap tag provides extra padding values ; it may contain the following attributes:

  • horizontal : left and right padding for menu items.
  • vertical : top and bottom padding for menu items.
  • icon : space between icon and text.

The Icon tag gives the size of icons thanks to its attributes:

  • menu : size for icons of the usual menus.
  • dmenu : size for icons of the dynamic menu.
menu size

3.3.3. Switch panels.

As there are two kinds of panels, the Panel tag contains more than only one tag:

The Icon has the following attributes:

The Window and Desktop tag can have the attributes:

  • left : left padding for the text.
  • right : right padding for the text.
panel size

3.4. Text related information.

Text properties are located in:

<FireboxTheme>
    <Text>
    ...
    </Text>
</FireboxTheme>

Five types of font are used. Each one is materialized by a tag:

In order to define its properties, each tag can have three sub tags.

3.4.1. Font name.

The text of the Font tag describes the font to use for a given text.

The font string is the one produced by tools such as xfontsel.

3.4.2. Alignment.

The text of the TextAlignment tag defines where the text is placed in the area.

There are three legal values:

By default, only the titlebar text is centred. All the others are printed on the left.

3.4.3. Shadow position.

The TextShadow tag can have the following attributes:

3.5. Used colors.

As theme objects are used for rendering, there is no need of a lot of extra color definitions. Only colors for printing are lacking. That is why 2x4=8 tags are introduced. At first, the basic ones:

As shadows can be added, four extra tags are also added:

By default, shadow colors are all black.

All of these tags are located in:

<FireboxTheme>
    <Colors>
    ...
    </Colors>
</FireboxTheme>

Each tag can have four attributes to refine the colors according a given state:

Depending on the target, it does not make sense to use all of these colors in all cases. For example, panels do not have a selected state.

Here is a sample of color definition:

<Colors>
    <MenuItem normal="#c0c0c0" active="#ffffff"/>
</Colors>

3.6. Pictures for titlebar buttons.

All this section is located in:

<FireboxTheme>
    <TitleBarButtons>
    ...
    </TitleBarButtons>
</FireboxTheme>

There are four states for the titlebar buttons:

For each of these four states, four kinds of buttons can be defined:

Depending on the position of each of theses buttons, four pictures can be provided:

The filenames have to be given with no path. And all definitions must be grouped. For instance:

<TitleBarButtons>

    <Normal>
        <Close>
            <Default>button_close_n.png</Default>
            <LeftEnd>button_close_n_left_end.png</LeftEnd>
        </Close>
        <Maximize>
            <Default>button_max_n.png</Default>
        </Maximize>
    </Normal>

    <Pressed>
        <Close>
            <Default>button_close_s.png</Default>
        </Close>
    </Pressed>

    <FocusLess>
        <Maximize>
            <Default>button_u.png</Default>
            <Alone>button_u_alone.png</Alone>
        </Maximize>
    </FocusLess>

</TitleBarButtons>

If a position is not used, then the default picture is used. If a button does not appear for a given state, then the hardcoded version is used.

3.7. Basic bricks for display.

3.7.1. Common base.

A brick refers to an area to be rendered. All basic bricks share one screen coordinates and one size.

The coordinates are given by the Position tag. This tag has two main attributes:

Theses two attributes can have numerical values, but also some special string keywords:

By default, a position is initialized with the following values:

<Position x="0" y="0"/>

Moreover, values can be combined using plus and minus. For instance:

<Position x="%SOUTH% + 23 - %RBUTTONS%"/>

To summarize (all the squares are 20x20 big):

basis position
A: default ; no need of definition.
B: <Position x="31" y="%MID_POSITION%"/>
C: <Position x="%MID_POSITION%" y="%MID_POSITION%"/>
D: <Position x="%MID_POSITION% + 20" y="%MID_POSITION% - 20"/>
E: <Position x="%MAX_POSITION% - 20" y="%MAX_POSITION%"/>

To compute the size of an item, there is the Size tag which is working like the Position tag ; thus it has two main attributes, too:

These two attributes can have numerical values, but also some special string keywords:

By default, a size is initialized with the following values:

<Size width="%MAX_SIZE%" height="%MAX_SIZE%"/>

To continue with the sample panel (let us consider that %APPICON% is equal to 28 pixels):

basis position
A: <Size width="50" height="20"/>
B: <Size width="20"/>
C: <Size width="20" height="%MAX_SIZE% - %APPICON%"/>
D: <Size height="20"/>
E: <Size width="20" height="20"/>

The only exception for default size is with pictures (see below): default values are equal to the image dimensions.

3.7.2. How works the machinery ?

Window shapes and rendering objects share a lot of common points. That is why they are handled in a similar way.

Both of them are defined by a position and a size. So both of them can have one Position tag and one Size tag as basic properties. Theme shapes and theme objects will then extend these properties by their own tags.

Another major point is that any shape or object can contain other shapes and objects.

Thus, items are handled like this: parent first, children next. And each time an item is processed, its available work area is restricted to its parent's one.

For instance:

<ThemeObject type="rect">
    <Colors bg="#ffffff"/>

    <ThemeObject type="rect">
        <Colors bg="#ffff00"/>
        <Size height="55"/>

        <ThemeObject type="rect">
            <Colors bg="#ff0000"/>
            <Position x="%MID_POSITION%" y="10"/>
            <Size width="20"/>
        </ThemeObject>

    </ThemeObject>

    <ThemeObject type="rect">
        <Colors bg="#ffff00"/>
        <Position y="%MAX_POSITION%"/>
        <Size width="60" height="120"/>

        <ThemeObject type="rect">
            <Colors bg="#ff0000"/>
            <Position x="%MID_POSITION%" y="10"/>
            <Size width="20"/>
        </ThemeObject>

    </ThemeObject>

</ThemeObject>
basis position

The red areas are not the same, whereas they have the same definition. That is because of their parent yellow area, on which their position and their size are computed.

3.7.3. Window shapes.

Shapes define regions that are subtracted to the original surface of the target. Basically, their main aim is to produce non rectangular windows.

Thus, the Shape tag can have two attributes:

By default, the operation attribute is not used.

Four types of shapes are supported.

The placebo_shape type is an empty theme shape. It aims to only contain other theme shapes.

The rect_shape type defines a rectangular shape. There is no need of extra tags other than the Position and Size ones (if needed).

For instance:

<Shape xsi:type="rect_shape">
    <Position x="5" y="5"/>
    <Size width="%MAX_SIZE% - 5" height="%MAX_SIZE% - 5"/>
</Shape>

The poly_shape type creates a polygonal shapes. It uses as many Point tags as wanted, which are only renamed Position tags.

For instance:

<Shape xsi:type="rect_shape">
    <Size width="66" height="77"/>
    <Point x="5" y="5"/>
    <Point x="15" y="25"/>
    <Point x="45" y="33"/>
</Shape>

Finally, the img_shape type loads the alpha layer of a picture to build a shape. Like for theme objects, it drives to two extra tags:

Right values for this last tag are:

For instance:

<Shape xsi:type="img_shape">
    <Source>picture.png</Source>
    <Scale>tiled</Scale>
</Shape>

3.7.4. Rendering objects.

Theme objects are small bricks for rendering. The ThemeObject tag can only have one attributes:

Five types of objects are supported.

The placebo type is an empty theme object. It aims to only contain other theme objects, or to mark some areas for further processing with its Area tag, which must have one of the following string values:

The line type draws line or polygons. It uses as many Point tags as wanted, which are only renamed Position tags. The rendering color is provided by the border attribute of a Colors tag.

For instance:

<ThemeObject xsi:type="line">
    <Colors border="#000000"/>
    <Point x="2" y="2"/>
    <Point x="%MAX_POSITION%" y="10"/>
</ThemeObject>

The rect type draws a rectangle, filled or not. It uses the bg and border attributes of a Colors tag for rendering. If one of these attributes is missing, then the background or the border (depending on the attribute) is skipped.

For instance:

<ThemeObject xsi:type="rect">
    <Colors bg="#000000" border="#00ff00"/>
    <Position x="1" y="1"/>
    <Size width="%MAX_SIZE% - 1" height="%MAX_SIZE% - 1"/>
</ThemeObject>

The img type draws pictures. Like for theme shapes, it drives to two extra tags:

Right values for this last tag are:

For instance:

<ThemeObject xsi:type="img">
    <Source>picture.png</Source>
</ThemeObject>

Finally, the gradient type defines gradients. Such object relays on several Point tags, which contains all the properties of the Position tag, plus one extra attribute named color which gives the current color for the current point.

For instance:

<ThemeObject xsi:type="gradient">
    <Position x="1" y="1"/>
    <Size width="%MAX_SIZE% - 1" height="%MAX_SIZE% - 1"/>
    <Point color="#ff0000"/>
    <Point color="#0000ff" x="%MAX_POSITION%" y="%MAX_POSITION%"/>
</ThemeObject>

3.8. Highlight border for windows.

Highlight border definitions are located here:

<FireboxTheme>
    <HighlightBorder>
        <Normal>
        ...
        </Normal>
        <Emergency>
        ...
        </Emergency>
    </HighlightBorder>
</FireboxTheme>
highlight borders

The Normal tag is used during window switching, the other one in case of urgency.

Both of them can have theme shapes and theme objects.

3.9. Client window body.

At first, theme shape for non rectangular clients can be defined in the Client tag, located in:

<FireboxTheme>
    <Client>
    ...
    </Client>
</FireboxTheme>

Client bodies rendering is divided into four parts:

  • TitleBar : the area containing the application icon, client title and buttons.
  • Title : the string provided by the running application.
  • Body : borders surrounding the user client.
  • Border : client's own internal borders (often 2-pixels thick).

The Border and Body tag are exceptional cases: they are drawn on the same area. The former is drawn first, the latter second. Then, the seven client handlers are added.

Thus, even if borders are features required by user windows, there is no need to render them as the theme objects in Body can do the job.

Firebox does not check if they overlap or not.

client

As the parts depend on the state of their client frame, each tag contains two extra tags:

These two state tags can contain theme objects for rendering.

If the unfocussed state is not defined, the focused one is used.

For instance, a client body sample could be:

<FireboxTheme>
    <Client>
    ...
        <TitleBar>
            <Focused>
            ...
            </Focused>
        </TitleBar>
    </Client>
</FireboxTheme>

3.10. Client handlers for resizing.

In order to allow resizing with mouse, small areas are attached to each client frame. For each of these areas, a tag is defined: TopLeft, TopRight, MidLeft, MidRight, BottomLeft, BottomMid, and BottomRight.

All of them are located in:

<FireboxTheme>
    <ClientHandlers>
    ...
    </ClientHandlers>
</FireboxTheme>

As the areas depend on the state of their client frame, each tag contains two extra tags:

These two state tags can contain theme objects for rendering.

If the unfocussed state is not defined, the the focused one is used.

3.11. Client and root menus.

Menus are composed of some elements:

menus
  1. Main panel (Board tag).
  2. Header entry (mainly in Head/Base tag).
  3. Default entry (Item/Normal).
  4. Separation (Separator tag).
  5. Active entry (Item/Selected tag).
  6. First entry of the list (FirstItem tag).
  7. Last entry of the list (LastItem tag).
  8. Arrow (see section 3.2.2).

3.11.1. Menu board.

If needed, a global theme shape and a global theme object can be defined in the Board tag:

<FireboxTheme>
    <Menu>
        <Board>
        ...
        </Board>
    </Menu>
</FireboxTheme>

3.11.2. Header entry.

The header can be defined with a theme shape and a theme object. Both of them are located in a tag called Base:

<FireboxTheme>
    <Menu>
        <Head>
            <Base>
            ...
            </Base>
        </Head>
    </Menu>
</FireboxTheme>

As the text of the entry can be surrounded by a particular rendering, it is also possible to add an extra theme object in the Caption tag:

<FireboxTheme>
    <Menu>
        <Head>
            <Caption>
            ...
            </Caption>
        </Head>
    </Menu>
</FireboxTheme>

3.11.3. Common entries.

Depending on the position of the item to be rendered, there is a fine-grained definition. Thus three tags (FirstItem, Item and LastItem) are used to draw menu items.

These definitions are located in:

<FireboxTheme>
    <Menu>
        <FirstItem>
        ...
        </FirstItem>
        <Item>
        ...
        </Item>
        <LastItem>
        ...
        </LastItem>
    </Menu>
</FireboxTheme>

NB: the FirstItem tag is not used if a menu header has already be drawn in the same menu.

NB2: for the dynamic menu, only the Item tag is used.

Depending on the state to render, theses tags can have sub tags called Selected and Normal. Each of them can contain both a theme shape and a theme object.

As the text of all these entries can be surrounded by a particular rendering, it is also possible to add an extra theme object in the ItemCaption tag:

<FireboxTheme>
    <Menu>
        <Head>
            <ItemCaption>
            ...
            </ItemCaption>
        </Head>
    </Menu>
</FireboxTheme>

3.11.4. Separator bar.

The separator bar can not always be a simple bar. Because its layout is involved in the global display of a menu, its shape has to be considered.

That is why a theme shape and a theme object may be located in the Separator tag:

<FireboxTheme>
    <Menu>
        <Separator>
        ...
        </Separator>
    </Menu>
</FireboxTheme>

3.11.5. Dynamic menu board.

As the dynamic menu shares lots of things with common menus, it does not need special part for its rendering.

Its panel background is the only item which can be customized. Thus the DMenuBoard tag allows to define it thanks to a special theme object.

This definition is located in:

<FireboxTheme>
    <Menu>
        <DMenuBoard>
        ...
        </DMenuBoard>
    </Menu>
</FireboxTheme>

3.12. Switch panels.

3.12.1. Window panel.

The WindowPanel tag describes the look of the panel shown when switching between windows.

It can contain a theme shape and a theme object ; both of them are stored in:

<FireboxTheme>
    <WindowPanel>
    ...
    </WindowPanel>
</FireboxTheme>
window panel

3.12.2. Desktop panel.

The WindowPanel tag describes the look of the panel shown when switching between desktops.

It can contain a theme shape and a theme object ; both of them are stored in:

<FireboxTheme>
    <DesktopPanel>
    ...
    </DesktopPanel>
</FireboxTheme>
desktop panel

3.12.3. Desktop cells.

To customize the small cells of the desktop panel, two extra theme objects can be used.

They are located in:

<FireboxTheme>
    <DesktopPanel>
        <SelectedDeskCell>
        ...
        </SelectedDeskCell>
        <DeskCell>
        ...
        </DeskCell>
    </DesktopPanel>
</FireboxTheme>

Appendix.

4.1. Default key bindings.

The key combo has the following syntax: Modifier[Modifier[Modifier...]]-Key. The available modifiers are:

Here are the basic default key bindings:

AS-Tab Show the previous client window.
A-Tab Show the next client window.
CA-Left Move to the previous virtual desktop.
CA-Up Move to the upper virtual desktop.
CA-Right Move to the next virtual desktop.
CA-Down Move to the lower virtual desktop.
A-S Display the customized dynamic menu.
A-P Display the dynamic menu containing all programs found in $PATH.
A-Return Run a terminal using the $TERM environment variable.

When a normal menu is shown, the following keybindings are used by default:

Left Select the parent menu, if any.
Up Select the previous item, or the last one if none.
Right Select the first child menu, if any.
Down Select the next item, or the first one if none.
Return Execute the selected menu item.
Escape Hide the current menu.

Here are the default key bindings used with dynamic menus:

End Select the last dmenu item.
Right Select the next item, or the first one if none.
C-Right Select the first item in the next range of items.
Left Select the previous item, or the last one if none.
C-Left Select the first item in the previous range of items.
Home Select the first dmenu item.
BackSpace Delete the last typed character.
Return Execute the selected menu item.
Escape Hide the dynamic menu.

4.2. XML validation schemas.

The files are located in the schemas/ directory in the main package.

The typical command to validate a XML file is to run:

$ xmllint --schema reference_schema.xsd my_file_to_validate.xml > /dev/null

For themes definitions, the right schema is theme.xsd.

HTML 4.01 Intuxication CSS