K-Meleon

KMeleonWiki > Documentation > ConfigFiles

K-Meleon's Configuration Files


The configuration of K-Meleon is controlled mainly by these four files:

Each profile that you create can have a different configuration by editing these files.

Note: Since K-Meleon 1.1, the information given on this page is partly outdated and incomplete. Please refer to kko's K-Meleon 1.x Reference (external).


Menus (menus.cfg)

The menus.cfg file is parsed top to bottom. It's only read in once. That means you have to define things above where they are used.

  • A line that starts with # is a comment and is ignored.
  • A line with a { on it starts a menu. Everything before the { is the menu name.
  • A line that has a } on it ends a menu. Everything else on the line is ignored.
  • A line with a - on it adds a separator to the menu.
  • A command that starts with a : adds a submenu to the menu.
  • The & character will underline the following letter for use of keyboard shortcuts.
  • A line that has an = on it is a menu item. Everything on the left of the = is displayed on the menu.
  • You can use \t to insert a tab such as to separate labels from the key.
  • On the right side of the = is the command id that the menu item corresponds to.

Note: Since K-Meleon 1.1, this information is partly outdated and incomplete.
There are now 2 menu files, a long one for default menus and a short one in the profile folder for user customizations. It will open by Edit > Configuration > Menus
Please refer to kko's K-Meleon 1.x Reference (external).

Example

# This will create the main menu bar with the File menu,
# that when opened has the command to open a new window.

&File {
&New Window\tCtrl+N = ID_NEW_BROWSER
}

Main {
:&File
}


Accelerators (accel.cfg)

Accelerators are keyboard shortcuts that can be linked to internal functions of K-Meleon. They are stored in the accel.cfg file. There is a a long one for default menus in the defaults/settings folder, and a short one in the profile folder for user customizations. It will open by Edit > Configuration > Accelerators

As usual all lines starting with # are comments (ignored). Each accelerator definition consists of 2 parts separated by an = sign:

<key1> [<key2> [<key3> [<key4>]]] = <command>

<keys> -> The declaration of the combination of the keyboard keys (See next list of predefined key names).
<command> -> The command itself, can be a command ID ("ID_..."), plugin command "<pluginName>(<pluginCommand>)" or macro function "macros(<macroName>)". Note that plugin and macro commands are ignored when the addressed plugin or macro is not present, i.e. not loaded or not exist.

The keys

You can use a combination of any number of control key (Alt/Ctrl/Shift) and one normal key.

Control keys are:

CTRL
SHIFT
ALT


Normals keys are standard alphanumeric symbols (A-Z, 0-9, rest of symbols) and the following constants for special keys:

  VK_ESCAPE
  VK_F1
  VK_F2
  VK_F3
  VK_F4
  VK_F5
  VK_F6
  VK_F7
  VK_F8
  VK_F9
  VK_F10
  VK_F11
  VK_F12

  VK_TAB
  VK_CAPITAL   (Shift Lock)
  VK_BACK
  VK_RETURN
  VK_SPACE
  VK_MENU   (Alt Gr)

  VK_PLUS   (normal +, not numpad)
    Note: VK_PLUS is the code of the key, not the code of the symbol!
          If, for example, the + is accessed by pressing Shift and the key, then
          VK_PLUS corresponds to pressing the key only (without the Shift key).
  VK_MINUS   (normal -, not numpad) (same remark as for VK_PLUS)

  VK_LWIN   (left Windows key)
  VK_RWIN   (right Windows key)
  VK_APPS   (menu key)

  VK_PRINT  or  VK_SNAPSHOT   (this key doesn't work for K-Meleon accelerators)
  VK_SCROLL
  VK_PAUSE

  VK_INSERT
  VK_DELETE
  VK_HOME
  VK_END
  VK_PRIOR  or  VK_PAGE_UP
  VK_NEXT  or  VK_PAGE_DOWN

  VK_LEFT
  VK_UP
  VK_DOWN
  VK_RIGHT

  VK_NUMLOCK
  VK_DIVIDE   (/ on numpad)
  VK_MULTIPLY   (* on numpad)
  VK_SUBTRACT   (- on numpad)
  VK_NUMPAD0
  VK_NUMPAD1
  VK_NUMPAD2
  VK_NUMPAD3
  VK_NUMPAD4
  VK_NUMPAD5
  VK_NUMPAD6
  VK_NUMPAD7
  VK_NUMPAD8
  VK_NUMPAD9
  VK_ADD   (+ on numpad)
  VK_DECIMAL   (. on numpad)

And for the mouse buttons:

  LButton
  MButton
  RButton

The commands

An accelerator can be linked to 3 types of elements:

Conditional accelerator definition

You can define accelerators dependent on the absence/presence of a plugin:

%ifplugin <pluginName>
        ...
%else
        ...
%endif

The %else part can be omitted (it's optional).

Examples

CTRL O = ID_FILE_OPEN
CTRL ALT VK_F4   = ID_APP_EXIT
VK_ESCAPE = ID_NAV_STOP
SHIFT VK_LEFT = ID_NAV_BACK
CTRL ALT SHIFT P = ID_LINK_ABOUT_PLUGINS

# plugin function
%ifplugin bookmarks
CTRL D = bookmarks(add)
%endif

# macro function
CTRL VK_RETURN = macros(ctrl_enter)

You can find more examples in accel.cfg file in your \K-Meleon\defaults\settings subfolder.


Macros (*.kmm)

K-Meleon macros are adding more functions. Some are already included out-of-the-box and needed for basic native functions, others are optional and can be added or customized by users.
You can place macros (kmm files) either in the global macros folder, to work in all profiles, or in a profile macros folder, working only for individual profiles.
A macro can be deleted again by deleting its kmm file, or only temporarily disabled in the preferences (F2 > Macro Extension)
Macros can be customized by editing the kmm file in a text editor. Little things like e.g. renaming a menu line or changing a hardcoded file path are rather easy and require no learning. For more complicated things take a look at the macrolanguage or ask in the forum.

New macros can be found in the Macro Library, the forum and other places, see Resources.

The macro language is explained in the Macro Language section.

Up until K-Meleon 1.0 all macros were stored together in the file macros.cfg (obsolete).
In newer versions (1.1 or younger) that system was improved and the old single file was split into several files, which are now stored in the folder "macros". Those new files are named *.kmm. Each kmm macro can now group together several single macro commands inside. Typical example: a kmm "macro" creates a menu block, and the single "macros" inside create the single lines in that menu.

Note: Since K-Meleon 1.1, this information is partly incomplete. Please refer to kko's K-Meleon Macro Language reference (external).


Toolbars (toolbars.cfg)

Toolbars are stored in a file named toolbars.cfg. It determines which buttons are shown, on which toolbar, which images they have and which actions or menus they execute.
Each skin has its own file, in its own folder, with its own images. You can modify it or override the default file by placing your own copy in your profile directory.
The configuration of the currently used skin will open by Edit > Configuration > Toolbars. It's strongly recommended to create a backup copy before modifying it, or even better copy the whole skin folder to a new name, to keep the default skin original.

The file is constituted of a set of toolbars, which in turn are made of buttons.
Attention, unlike other programs, in K-Meleon the selection of visible buttons is directly dependent on the active skin. That means, switching to another skin (F2 > GUI Appearance) will also change which buttons are shown and what they do, not merely change the looks of them!

It is possible to copy over buttons and whole toolbars from one skin to another, but requires a bit learning if the toolbars and bmp images happen to have different names. If you only want to change the action of a given button, or add a menu when right-clicking it, that's easy though, only means to change 1 line of text in the toolbars.cfg.

The format of toolbars.cfg is as follows:
(not as complicated as it looks here, just open an existing toolbars.cfg to have a look)

ToolBar Name(16,16) {     # (width,height) is optional, defaults to (16,16)
  Button Name(16,16) {     # (width,height) is optional, defaults to toolbar dimensions
    Command | Menu Name     # command (required): ID command, plugin command, or macro
                       # | Menu name is optional (as defined in menus.cfg) and is showed with right click
    Tooltip text         # Tooltip text
    c:\toolhot.bmp[2]    # hot image = when a button is pressed or mouse on it (optional)
                            #   [2] (optional) is the zero based index of the image within the file, defaults to 0
    c:\toolcold.bmp[2]   # cold image = normal state (optional)
    c:\tooldead.bmp[2]   # disabled image = function broken (optional)
  }     # End of Button
  -                     # display a vertical separator
  Button 2 {
    Command 2
    Tooltip 2
  }
}     # End of Toolbar

# Note: No toolbar images = Text based toolbar with button names for images

Toolbar 2 {
  Button 1
  ...
  Button 2
  ...
}

The command is either a command ID, a plugin command or a macro.
A list of the native commands can be seen by clicking Edit > Configuration > Commands List. More are possible.

If you don't specify any images in the toolbar, it will become a text toolbar showing the button names in place of images.

Where to find toolbar and button configurations:

  • View > Toolbars
  • Edit > Preferences (F2) > GUI Appearance > Toolbars
  • Edit > Preferences (F2) > GUI Appearance > Skin
  • Edit > Preferences (F2) > K-Meleon Plugins > Full Screen / Bookmarks / Favorites / Hotlist
  • Edit > Configuration > Toolbars
  • Edit > Configuration > Commands List
  • Toolbars and buttons can also be created by macros (kmm files)

Toolbar tips

  • You can very easily change the toolbar background to an image of your liking, by simply replacing the image back.bmp in the current skin folder.
  • You can hide the thin borders between toolbars: Open about:config (Edit > Configuration > Browser Configuration) and set the pref "kmeleon.display.toolbars_line" to "false".
  • Want to use a new macro command on a button? Get a bmp image somewhere, place it in the skin or skin default folder. Add the button definition to toolbars.cfg. To find the function name, open the macro kmm file and look in the setmenu lines for the name it shows in the browser menu. Directly after it is the name of the macro command you need.
  • If you create a folder named "default" in the skins folder, the button images in it can be accessed by all skins as if they were in their own folder.
  • If you prefer not to touch the original skin (recommended), you can either copy the whole folder to a new name, or even just copy over the few things you want to change in it. If the new name is the same as the old one and only extended with some name in (), for example "Phoenity(Large)", then the toolbars.cfg in it will get missing images from the neighbor folder "Phoenity". If they are not there either, it will look in folder "default".
  • If you want to create a whole new toolbar, just think up a name for it and write it into toolbars.cfg. Use the same syntax as the other toolbars have.

Examples

K-Meleon default toolbar:

internal://abdae542f2a2961e09f7201149d6d620.gif

IE-like toolbar:

internal://9e19f3ee71cabf901c1ac58d74f4d6e4.gif

K-Meleon

(c) 2000-2010 kmeleonbrowser.org. All rights reserved.
design by splif.