Since version 2.0 format of configurational file was changed. Description of format of configurational file for versions 1.X could be found here.
You may find some predefined configuration files in cfg-examples/Server-style directory:
You may find some predefined configuration files for Bemused emulation in cfg-examples/Bemused-emulation directory:
All examples have on-screen help binded to "* *" (press "*" two times).
I hope after investigation of these configuration files You'll become more familiar with its format.
Description of configurational file format (Server-style):
AutoRepeat=false
Auto repeat feature (as on PC keyboard - about 10 events per second). Usefull for mouse emulation, for example. Default value is false.
Baudrate=19200
Baudrate to use; default value is 19200
Device=bluetooth:10
Device to connect; default value is /dev/rfcomm0.
If kAnyRemote works as server correct value for Device could be: Device=socket:"port" or Device=bluetooth:"channel"or just Device=bluetooth (to choose first available channel).
Log=true
Print or not to print logging info to the file /tmp/kanyremote.log, default value is false.
Debug=true
Print or not to print verbose logging info to the file /tmp/kanyremote.log, default value is true.Works only if Log=true.
Screen=true
Send or don't send any commands (SetStatus(), SetTitle(), etc.) to phone. Default value is false.
[Aliases] section
Format:
Key_Code=New_alias
1=One 49=Oneand then use "One" in [Keys] section instead of "1" or "49"
[Keys] section
A short example:
[Keys] (Init)=Exec(kdialog --msgbox "Initialized"); (Connect)=Exec(kdialog --msgbox "Connected on $(Time)") (Disconnect)=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) [End]
Format:
Key_Codes=Command1;Command2;Command3;....
Where CommandX could be:
Exec() command
1=Exec(kdialog --msgbox 1) 2=Exec(kdialog --msgbox 2)
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) [Mode]=1 1=Exec(kdialog --msgbox 1_in_Mode_1) 2=Exec(kdialog --msgbox 2_in_Mode_1) [ModeEnd] [Mode]=2 1=Exec(kdialog --msgbox 1_in_Mode_2) 2=Exec(kdialog --msgbox 2_in_Mode_2) [ModeEnd]
It is possible to write rather 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)
Command could be parametrized (see Set(list ...) command for details) command for details):
List($$)=Exec(kdialog --msgbox $(Param))
Set() command
This command used to control and customize GUI of Java client. It is possible to change:
|
![]() |
![]() |
This command also could be used to:
|
![]() |
![]() |
Thare are several ways to use this command:
Set(icons, ...)
Format: SetI(icons,caption,1,name1,2,name2...,*,name11,#,name12)
where nameX specifies desired action. This command sets the caption of Java client window and reports to Java client to dynamically change shown icons.
1=Exec(xmmsctrl play);Set(icons,XmmsPlaying,5,stop,1,kill);
if You do not want to change the caption of Java client window then it is possible to write:
2=Exec(xmmsctrl play);Set(icons, SAME,5,stop,1,kill);
Set(title, ...)
Format: Set(title, new_title)
This command sets the title field of Java client
3=Exec(xmms);Set(title,XMMS);
Set(status, ...)
Format: Set(status, new_status) This command sets the status field of Java client
4=Exec(xmmsctrl play);Set(status, Playing)
Set(bg ...)
Format: Set(bg,R,G,B)
Where R, G, B values should be beetween 0 and 255. This command sets the background color of Java client. For example to set background to blue:
3=Set(bg,0,0,255);
The simples way to determine appropriare RGB value is to run KolourPaint program and then open Select Color dialog.
Set(fg ...)
Format: Set(fg,R,G,B)
Where R, G, B values are beetween 0 and 255. This command sets the foreground color of Java client. For example to set foreground to blue:
3=Set(fg,0,0,255);
Set(font ...)
Format: Set(font,small|medium|large)
This command set the font size for title and status fields of Java client. Java realization in the phone could not support some of font sizes. On SE phones medium font looks the same as large one. For example to set small font size:
3=Set(font,small);
Set(vibrate)
Format: Set(vibrate)
This command switches on internal vibrator of the phone (if exists) for 1/2 sec.
3=Set(vibrate);
Set(text, ...)
Format: Set(text,title,add|replace|show|clear|close, _long_text_) This command shows help test on the screen of cell phone.
#=Exec(xmmsctrl quit);Set(text,replace,Help,To run Xmms press 1)
It is possible to add line break characters to the text. It could be done with "\n". The length of the text which can transferred to phone limited to 4 KBytes.
Set(list ...)Format: Set(list,add|replace|clear|show|close|menu,title,_list_or_menu_data_)
This command used to create and manage lists. It could be useful to manage player playlists or to browse directory structure. See detailed description here.
3=Set(list,replace,Shell commands,reboot,shutdown,uptime,dmesg);
Set(skin ...)
Format: Set(skin,default|bottomline|bottomarc[,keypad_only|joystick_only][,ticker|noticker])
This command used to choose icon layout ("skin") to show. There are 3 icon layouts defined: default, bottomline and bottomarc. If keypad_only parameter specified, then it will be possible to send commands only by pressing numeric keys. If joystick_only parameter is specified, then it will be possible to send commands only by pressing joystick central button. If ticker parameter is specified then ticker (running text) will be used to show title field instead of static text. If noticker parameter is specified then title field will be shown as static text. In bottomline and bottomarc icon layouts if there will be not enough space on phone screen to show all icons, then some of them will be omitted. A note about Nokia: Nokia-6021 does not send events from Select (push joystick) button in graphic mode. It is possible to use Send (green) button instead. |
![]() |
![]() |
Format: Set(filemanager,add|replace,left|right,_list_of_files)
This command used to show file manager window. It looks like MC and allows to do basic file operations. See cfg-examples/Server-style/fileManager2.cfg for details how it works. |
![]() |
![]() |
Format: Set(fullscreen,on|off)
Set fullscreen mode on or off.
3=Set(fullscreen,on);
Set(editfield ...)
Format: Set(editfield,caption_value,label_value,init_value)
Shows edit field on phones screen. When used press OK, then message label_value(0,_entered_value_) will be sent to server.
3=Set(editfield,Enter parameters,Parameters,Enter your data here);
For example, if user enters, say - new_line - and press OK, then message Parametes(0,new_line) will be sent.
Set(debug ...)
Format: Set(debug,on|off)
Switch on/off debug information printing in Java Client. Useful for debugging.
3=Set(debug,on);
ExecAndSet()
Format: ExecAndSet(tag,command)
This command similar to the Set(), but uses the output of command specified as a string to set GUI element of Java client specified in tag field..
5=ExecAndSet(title,dcop amarok player nowPlaying); 6=ExecAndSet(status,date)Timer()
Format: Timer(timerId, timeout, maxTimes, tag, command)
This command similar to the ExecAndSet(), but it will be executed periodically by timer.
For example, the following command run 'dcop amarok player nowPlaying' command 2 times with timeout equal to 5 sec and set result to the title field of Java client:
7=Timer(id1, 5, 2, title, dcop amarok player nowPlaying)
The following command run 'date' command every 10 sec and set result to the status field of Java client:
8=Timer(id2, 10, 0, status, date)
It is impossible to have two active timer commands with the same timerId. If results of the executed command is the same as previous one, then results will not be sent to Java client.
CancelTimer()Format: CancelTimer(timerId)
This command deletes timer previously created by Timer() command by specified timerId.
9=CancelTimer(id1)
The following commands used mainly in Bemused-emulation:
Send()
Format: Send(string, string_value)
or Send(byte, byte_value1, byte_value2,...)
Send to the Java client specified string or sequence of bytes. This command is used mainly in Bemused server emulation.
1=Send(string, simple_string)
byte_valueX is string representation of 1 - 255 values. Send(byte, ...) command sends to the Java client specified bytes of data, one by one. Mainly this command is used to Bemused server emulation.
2=Send(bytes,35,42,0)
ExecAndSend()
Format: ExecAndSend(tag,command)
This command similar to the Send(tag, ...), but uses the output of command specified as a string to send. This command is used mainly in Bemused server emulation.
3=ExecAndSend(string,date)
There are several "internal" commands:
TempDisconnect used to temporary (1 minute) disconnecting from phone:
1=TempDisconnect;
Exit command used to exit from application:
2=Exit;
Switch off "remote control" functionality without disconnecting:
3=RemoteOff;
Switch on "remote control" functionality:
4=RemoteOn;
Change mode:
5=SetMode(xmms)
There are several "events" could be triggered:
(Init) event will be fired when anyRemote is initialized:
(Init)=Exec(kdialog --msgbox "Initialized")
(Connect) event will be fired when connection established:
(Connect)=Exec(kdialog --msgbox "Connected on $(Time)")
(Disconnect) event will be fired when connection is lost:
(Disconnect)=Exec(kdialog --msgbox Disconnected)
Auto-lock example:
(Connect)=Exec(killall kdesktop_lock) (Disconnect)=Exec(kdesktop_lock --forcelock)
Incoming call handling. Not sure it will works for all JSR-82 capabled phones. But it works at least for SE-K750.
(InCall)=Exec(kdialog --msgbox "Incoming call")
End of call handling. Not sure it will works for all JSR-82 capabled phones. But it works at least for SE-K750.
(EndCall)=Exec(kdialog --msgbox "Call ends")
Auto-mute example (amixer utility should be installed, example is for soundcard #0):
(InCall)=Exec(amixer -c 0 sset Master,0 mute);RemoteOff (EndCall)=RemoteOn;Exec(amixer -c 0 sset Master,0 unmute)
Take a look to the order of commands above. RemoteOff command is the last one. If You change order to
(InCall)=RemoteOff;Exec(amixer -c 0 sset Master,0 mute)
then Exec(amixer -c 0 sset Master,0 mute) will not be executed.
If mode is changed by SetMode() then (ExitMode) event for current mode and (EnterMode) event for the new mode will be fired:
*=SetMode(XMMS) (ExitMode)=Exec(kdialog --msgbox "Exiting from current mode") [Mode]=XMMS % Do some initialization steps (EnterMode)=Exec(kdialog --msgbox "Enter to XMMS mode");Exec(xmms) % Do some cleanup steps (ExitMode)=Exec(kdialog --msgbox "Exiting from XMMS mode");Exec(killall xmms)
Variable substitution:
In Exec(), ExecAndSet() and Timer() commands is it possible to use several predefined internal "variables".
Current time will be substituted instead of $(Time):
2=Exec(kdialog --msgbox $(Time))
Current mode be substituted instead of $(Mode):
3=SetMode(xmms);Exec(kdialog --msgbox "New mode is $(Mode)")
There are $(Param) and $(Index) variables defined in handling command issues from Java Client lists. See for details.
Choose($$)=Exec(xmmsctrl track $(Index));Exec(kdialog --msgbox "Selected track is $(Param)")
[Alarms] section
Format:
Alarm_file=command1;command2;...
When file Alarm_file will be created, then command1, command2 ... will be executed.
/tmp/alarm1=SetStatus("xmms was stopped")