Syntax Rules for Configuration Files
This chapter describes the syntax rules for the configuration files.
The main configuration file shell.nss
(or shell.shl
in older installations) is located in the installation directory of
Shell, depending on your installation method.
General rules
- Syntax is case-insensitive.
- Spaces around the equal (
=
) sign are optional and are ignored. - The properties of static and dynamic items are separated
by blank spaces or on a separate line and must be placed in
parentheses
( )
. - Other configuration files can be imported using the import tag.
shell.log
, which is also located in
your installation directory.).
shell.nss structure
The global section shell{}
may have the following subsections:
- Section var{} for global variables. Optional.
- Section set{} for settings. Optional.
- Section static{} with
instructions on how to change existing menuitems. Optional.
- Static items are only of one type: item.
- Section dynamic{} with
definitions for new menuitems.
Optional.
- Dynamic menuitems may have one of three types: menu, item, or separator (sep).
Example
shell
{
// global variables
var // variables
{
// variables content
variable-name = variable-value
...
}
set // settings
{
theme
{
set-name = set-value
...
}
set-name = set-value
set-name = [set-value, set-value, ...]
...
}
images
{
id = value
"item 1" = value
id1,id2, id3, "item 2" = value
....
}
// static items
static
{
// static items content
item ( property-name = property-value ... )
...
}
// dynamic items
dynamic
{
// dynamic items content
item ( property-name = property-value ... )
separator [( property-name = property-value ... )]
menu ( property-name = property-value ... )
{
var // local variables
{
variable-name = variable-value
...
}
item ( property-name = property-value ... )
...
}
...
}
}
Breaking Long Lines
For best readability, users often like to avoid lines longer than 80 characters. single quotes also allow break up a line.
shell
{
dynamic
{
item(title='Command prompt'
cmd='cmd.exe')
}
}
Import tag
To better organise the configuration file, parts of the configuration can be saved in separate files. These are then imported using the import tag. With this method, it is also possible to import the same file as a sort of "module" into different parts of the configuration. A convenient way to include the same sub-menu in different locations..
Syntax
The general syntax is as follows:
shell
{
[ %section% ] import %path%
}
Where
%section%
is the name of a section. Optional. If given, it must be one of- var
- set
- images
- static
- dynamic
%path%
is a string literal, that returns the path to the config file that shall be imported. This can be a relative path to the location of the file where the import tag is used, or it can be an absolute path. Expressions are supported when using single quotes.
There are effectively two different ways this tag is applied, depending on whether the optional
%section%
is given:
- Import an entire section
- Import as a partial:
Import an entire section
shell
{
// import an entire section
%section% import %path%
}
In this case, the content of the file found at %path%
will be imported into a newly
created section{}
.
The result would then look like so:
shell
{
// import an entire section
section {
/* content of the imported file goes here! Do not include
*
* section {
* }
*
* in your imported file!
*/
}
}
This syntax may be used only in the following places:
root section shell{}:shell import %path%
- the global sections
- var{}:
var import %path%
set{}:set import %path%
- images{}:
images import %path%
static{}:static import %path%
dynamic{}:dynamic import %path%
- var{}:
-
sub-sections of the set{} section:
set.theme{}:theme import %path%
set.theme.background{}:background import %path%
set.theme.item{}:item import %path%
set.theme.border{}:border import %path%
...set.tip{}:tip import %path%
set.exclude{}:exclude import %path%
set.static{}:static import %path%
set.dynamic{}:dynamic import %path%
Import as a partial
shell
{
section {
// some code might go here. Optional.
// import of a partial section
import %path%
// some more content might go here. Optional.
}
}
In this case, the content of the file found at %path%
will be imported into the already
existing section{}
.
The result would then look like so:
shell
{
section {
// some code might go here. Optional.
// import of a partial section
/* content of the imported file goes here! Do not include
*
* section {
* }
*
* in your imported file!
*/
// some more content might go here. Optional.
}
}
This syntax may be used nearly anywhere:
- in any section
- in the body of menu tags
This page is open source.
Noticed a typo? Or something unclear?
Improve this page on GitHub