Configuration file format: AT mode

Configuration file examples

You may find some predefined configuration files in cfg-data/AT-mode directory. After investigation of these configuration files You became more familiar with its format.


Line starting with a % considered as a comment line.

%This is a comment

Long command can be splitted into the several lines. You have to put backslash (\) as the last character to continue a command to the next line.

1=Exec(echo "this is first line");\
Exec(echo "this is second line");

Parameters section

GuiAppName="application name"

GuiAppBinary="name of executable"|"command which returns name of executable"

GuiAppRun="command do determine is application running or not; must returns OK or NOK"

GuiAppIcon="icon name"



GuiAppDesc=Some text

These parameters is used by GUI frontends only.

GuiAppRun=echo 'A=`dcop | grep amarok`; \
   if [ "x$A" == "x" ]; then echo NOK; \
   else echo OK; fi' | bash -f -s
GuiAppDesc=Application decription
One=Exec(echo "Hello world!");

[Protocol] section

A short example:


    Exec(kdialog --msgbox "Initialized");

    Exec(kdialog --msgbox "Connected")

    Exec(kdialog --msgbox "Disconnected")

1=Exec(kdialog --msgbox 1)
2=Exec(kdialog --msgbox 2)
3=Exec(kdialog --msgbox 3)
4=Exec(kdialog --msgbox 4)
5=Exec(kdialog --msgbox 5)




Where CommandX could be:

Exec() command

1=Exec(kdialog --msgbox 1)
2=Exec(kdialog --msgbox 2)

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

It is possible to define multi-key commands

3 1=Exec(kdialog --msgbox 3_1)
3 2=Exec(kdialog --msgbox 3_2)
3 3 1=Exec(kdialog --msgbox 3_3_1)

It is not good idea to define:

3 3=Exec(kdialog --msgbox 3_3)
3 3 1=Exec(kdialog --msgbox 3_3_1)

simultaneously, since only one command will works (which one - depends on search order).

It is possible to group keymappings in so-called "mode" to set more than one command to the key:

1=Exec(kdialog --msgbox 1)
2=Exec(kdialog --msgbox 2)
1=Exec(kdialog --msgbox 1_in_Mode_1)
2=Exec(kdialog --msgbox 2_in_Mode_1)
1=Exec(kdialog --msgbox 1_in_Mode_2)
2=Exec(kdialog --msgbox 2_in_Mode_2)

If current mode is not default mode (see Make(mode ...); command), then firstly key will be searched in current mode and if not found then it will be searched in default mode. As a result it needs to use (EnterMode) and (ExitMode) "events" very carefully in default mode.

It is possible to write quite complex commands inside Exec(), for example:

1=Exec(echo 'D=`dcop | grep digikam`; \
     if [ "x$D" == "x" ]; then digikam \
     else dcop $D MainApplication-Interface quit;' | bash -f -s)

Macro() command

This command used to create new keymapping:

Macro1=Exec(kdialog --msgbox 1);Exec(kdialog --msgbox 2)

Macro() command can contains condition:

0=Make(var,macro_test,echo "0");
2=Macro(Macro2, if [ -f /tmp/file_name ];\ 
                then true; else false; fi; echo $?)
Macro2=Exec(kdialog --msgbox "Condition is OK")

Conditional Macro() will be execute only if a result of variable substitution or execution of the command is equal to string "0".

Note: In shells result code of command execution stored in $? environment variable.

Timer() command


Timer(key, timeout, maxTimes) or

Timer(key, cancel|pause|continue)

This command sets/removes a timer for the key specified. A command sequence, associated with this key will be executed periodically.

For example, the following commands run 'ls -1' command 2 times with timeout equal to 5 seconds:

7=Timer(TimerCmd, 5, 2)
TimerCmd=Exec(ls -1)

The following command run 'date' command every 10 seconds:

8=Timer(Timer2, 10, 0)

It is impossible to have two active timer commands with the same key.

To delete existing timer use the following command:


Load() command

This command used to load commands from file and execute them:


Include() command

This command used to include definitions from external configuration file:


Definitions from included file will not rewrite any of existing definitions.

Make() command



This command used control local state of anyRemote.


See detailed description here.

SendCKPD() command

1=Exec(kdialog --msgbox 1);SendCKPD(E PAUSE E)

This command sends CKPD sequence back to phone and could be useful if You can't lock the keyboard and needs to clean-up phone screen after each key pressing on phone keypad. It is possible to use word PAUSE to make a 1-second pause before next CKPD command will be sent. This command works when anyRemote is in AT-mode.


Exit command used to exit from application.


Event handlers

There are several "events" could be triggered. See Event handlers page for details.

Variable substitution

In Exec(), Make(var,...), Load(), Include() commands is it possible to use internal "variables". See Variable substitution page for details.