Chapter 7. The Pekwm Common Syntax for Config Files

Table of Contents
7.1. Basic Syntax
7.2. Variables In Pekwm Config Files

7.1. Basic Syntax

All pekwm config files (with the exception of the start file- see start file ) follow a common syntax for options.


# comment
// another comment
/*
	yet another comment
*/

$VAR = "Value"
$_VARIABLE = "Value"
INCLUDE = "vars"
COMMAND = "program to execute and add the valid config syntax it outputs here"

# Normal format
Section = "Name" {
	Event = "Param" {
		Actions = "action parameter; action parameter; $VAR $_VARIABLE"
	}
}

// Compressed format
Section = "Name" { Event = "Param" { Actions = "action parameters; action parameters; $VAR $_VARIABLE" } }

You can usually modify the spacing and line breaks, but this is the "Correct" format, so the documentation will try to stick to it.

Events can be combined into the same line by issuing a semicolon between them. Actions can be combined into the same user action by issuing a semicolon between them. You can use an INCLUDE anywhere in the file.

Pekwm has a vars file to set common variables between config files. Variables are defined in vars and the file is INCLUDEd from the configuration files.

Comments are allowed in all config files, by starting a comment line with # or //, or enclosing the comments inside /* and */.

7.2. Variables In Pekwm Config Files

Pekwm config enables you to use both internal to pekwm variables, as well as global system variables. Internal variables are prefixed with a $, global variables with $_.

# examples of how to set both type of variables
$INTERNAL = "this is an internal variable"
$_GLOBAL = "this is a global variable"

# examples of how to read both type of variables
RootMenu = "Menu" {
	Entry = "$_GLOBAL" { Actions = "xmessage $INTERNAL" }
}

There is one special global variable pekwm handles. It is called $_PEKWM_CONFIG_FILE. This global variable is read when pekwm starts, and it's contents will be used as the default config file. It will also be updated to point to the currently active config file if needed.

Variables can probably be defined almost anywhere, but it's probably a better idea to place them at the top of the file, outside of any sections.