Configuration language

When starting, the xcontrolx program reads configuration statements from the command line or from configuration files (Configuration file).

Statement syntax

A configuration comprises a sequence of configuration statements, which follow some general rules:

Words are separated by arbitrary white space characters. The line structure is irrelevant.

If a word contains white space characters, it has to be surrounded by double quote characters ". This special meaning of the double quote character is overridden by preceding it with a backslash character \.

Keywords are case-insensitive: the meanings of connectTimeout and ConnecttimeOut are identical.

Keywords are not reserved.

Most configuration statements consist of the name of a parameter and its new value. The name may be written with or without a directly following colon :.

Many statements are valid in the context of a server or screen definition only. They are called sub-statements and must be introduced by the appropriate server (Server) or screen statement (Screen).

In the case of multiple parameter definitions with the same name, only the last one is valid.

The succeding sections describe the configuration statements by a formal syntax using the following elements:

keywords have special meanings.

variable_input depends on the configuration.

alternative_1|alternative_2: Alternatives are separated by a vertical bar.

[optional]: Optional parameters are surrounded by brackets.

parameter...: Repetition (one or more times) is denoted by the ellipsis.

{element}: Braces are used for grouping.

Default configuration

If the xcontrolx program is called without any arguments, the default configuration is effective. The following lines show almost all configuration statements with their default values (provided that the display connection of the master is :0, that the only slave is named remote:0, and that each has one screen only):

gui on
hotkey
gui none
exit none
telepointer
label user@server
height 22
foregroundColor "#ffffcccc0000"
backgroundColor "#000033336666"
crossDelay "0 ms"
crossKnocking off
feedback off
logDestination /var/opt/XSOXcontrolx/logs/xcontolx-user_name.html
server :0
connectTimeout "20 sec"
control
input
mode onEnter
priority 1
reserve on
telepointer
mode never
priority 0
reserve off
multi on
motionCompression off
motionSync off
commonKeyboardFocus off
commonSelection on
screensaverSync off
screen 0
northOf none
southOf none
eastOf none
westOf none
rotation 0
hotkey none to 0 0
server remote:0
connectTimeout "20 sec"
control
input
mode onTelepointerClicked
priority 1
reserve off
telepointer
mode onEnterOrInputLost
priority 0
reserve off
multi on
motionCompression off
motionSync off
commonKeyboardFocus off
commonSelection on
screensaverSync off
screen 0
northOf none
southOf none
eastOf none
westOf none
rotation 0
hotkey none to 0 0

Comments

Comments start with a number symbol # and extend to the end of the line.

If a comment — after elimination of white space characters — starts at the beginning of a line, it is associated with the last defined server (Server) or screen (Screen). When writing a configuration file, the configuration tool places these comment lines just between the corresponding server or screen statement and the following sub-statements.

The introducing comment lines preceding the first definition of a server or screen are preserved.

All other comments are ignored and not saved by the configuration tool.

Variables

The environment variables are accessed like in a shell, for example:

screen .0 westOf $remote.0

Variable assignments, however, follow a different syntax:

set variable_name value

like in:

set remote xsoft17:0

A variable name begins with a letter (including the underscore _) followed by letters or digits. Braces are used to separate the variable name in special situations:

set server1 xsoft17:
server ${server1}0

Lists

Some statements take as argument a list of individual items in the form of:

{[+|-]item}...

The optional sign determines whether an item is included or not: if an item specifier starts with a minus character -, then the corresponding item is deleted from the configured set of items, otherwise it is included into the set. The initial set depends on the first specifier: if it starts with a minus character -, the initial set contains all possible items, otherwise the initial set is empty.

Arithmetic expressions

Arithmetic expressions may contain the operators *, /, and % (modulus), + and - as well as variable references. They are surrounded by parentheses, for instance:

set inputPriority 2
set telepointerPriority ($inputPriority - 1)

Points of time and periods of time

The specification of a point of time follows an enhanced ISO syntax:

[year{-|/}month{-|/}day] hours:minutes[:seconds[.milliseconds]] [am|AM|pm|PM] [Z|{+|-hours:minutes}]

The following examples denote nearly the same time on August 20, 2008 in Central Europe:

2008-08-20 20:08:20.2008
20:08
18:08 Z
08:08 pm

The syntax for the specification of a period of time is similar:

[[hours:]minutes:]seconds[.milliseconds]

The following examples denote approximately the same period:

1:23:45.678
83:45
5025

Configuration file

The statement

source file_name|-

or, even shorter

file_name|-

is substituted by the contents of a configuration file. The file name - stands for the standard input stream. The file inclusions may be nested arbitrarily, but not cyclically.

The statement

stop

terminates the interpretation of a configuration file before reaching the end of the input. The remaining contents are neither read in nor saved by the configuration tool.

Copyright © 2018 X-Software GmbH
info@x-software.com