K-Meleon's menu definition file (menus.cfg) is located in the Settings Directory. It was introduced with K-Meleon 0.3 to allow customization of the menus. The syntax of this file has changed several times since it was introduced. Subject to this reference are only the 1.x versions of K-Meleon.
All menus have to be defined in the file's root, you cannot define a menu inside another menu:
<menuName>{
}
A menu can contain several types of menu items: commands, separators and other menus (and a variaty of special items):
<menuName>{
<label1>=<command1>
<pluginName>(<pluginCommand>,<label2>)
-
:<menuName1>
!<menuName2>
}
Note that plugin commands are ignored when the addressed plugin is not present i.e. not loaded.
1.1The syntax to define commands was unified in K-Meleon 1.1. In previous versions, plugin commands were treated different than ID commands.
Command labels could contain indicators for keyboard accelerators. The syntax used to be:
<menuName>{
<label1>\t<keys1>=<command1>
<pluginName>(<pluginCommand>,<label2>\t<keys2>)
}
1.02Since K-Meleon 1.02, these indicators are displayed automatically (if desired). The \t<keys> syntax is ignored.
A separator (a horizontal rule) is represented by a simple minus (-).
There are two ways to integrate a menu into an other one:
Note that a menu must be defined before beeing used as a submenu!
1.1Since K-Meleon 1.1 inline menus are automatically separated from preceding items (automatic separator insertion).
You can define menu items dependent on the absence/presence of a plugin:
%ifplugin <pluginName>
...
%else
...
%endif
The %else part can be omited.
Since version 1.1, K-Meleon can have two menu configuration files (both named menus.cfg). The first one is located in the Default Settings Directory, the second one can be created in the User Settings Directory and is dedicated to customize the default menus.
To define a new menu or to redefine an existing menu, the usual syntax is used:
<menuName>{
}
To add or to remove a menu item, you have to add an exclamation mark (!) in front of the parent menu's name:
!<menuName>{
}
Then specify the items to be added as usual:
!<menuName>{
<YourLabel>=<YourCommand>
-
:<YourMenuName1>
!<YourMenuName2>
}
You can also influence where items are added:
!<menuName>{
<YourLabel1>=<YourCommand1>|<positionIndex>
<YourLabel2>=<YourCommand2>|<command>
:<YourMenuName1>|<label>
!<YourMenuName2>|<menuName>
}
You can specify an integer position index to determine your item's position. When you specify a command, a menu name or a label, your item will be inserted before the matching item.
Similarly, you can specify items to be removed:
!<menuName1>{
-<menuName2>
-<label>
-<command>
}
See also the setmenu() macro statement.