How to create simple configuration file

Configuration file examples

You may find predefined configuration files in cfg-data directory. Firstly, take a look to the simple configuration file like cfg-data/Server-mode/template-player.cfg. After investigation of some configuration files You'll became more familiar with its format.

How To

Specify keys to handle

A short example, which:

1=Exec(kdialog --msgbox "Hello!")
3=ExecAndSet(status,date +"%M:%S")

Exec() command is the mostly used one. It is used to run specified command.

Set()/ExecAndSet() commands used to control look and behavour of the client, which is used in Server mode.

To make custom setup of the clients main window upon connection:

    Set(status,Connected now);\

As You can see it is possible to execute more than one command at once.

At the end, another "almost" real Server mode example which contols Amarok/KDE3 player:

% Run amarok when connected

% Volume control
1=Exec(dcop amarok player volumeDown)   
2=Exec(dcop amarok player mute)   
3=Exec(dcop amarok player volumeUp)   

% Play, rewind back and forward
4=Exec(dcop amarok player seekRelative -10)   
5=Exec(dcop amarok player play);Set(title,Playing);  
6=Exec(dcop amarok player seekRelative 10)   

% Previous song, stop playback and next song
7=Exec(dcop amarok player prev);  
8=Exec(dcop amarok player stop);Set(title,Stopped);  
9=Exec(dcop amarok player next);

% Pause playback
0=Exec(dcop amarok player pause);Set(title,Paused);   

Lines starting with % are considered as a comment.


anyRemote uses popen system call in Exec() command. This means that command will be executed inside /bin/sh command interpreter.

It is suggested to avoid explicit usage of other shells, like bash or ksh in configuration files. Please keep in mind that some embedded systems like OpenWrt does not contains such packages by default.