<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>anyRemote · Control your computer with your phone</title> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta name="description" content="anyRemote project page - Bluetooth remote control tool" /> <link rel="stylesheet" href="data/master.css" type="text/css" media="all" title="Default Style" charset="utf-8" /> <script src="data/effects.js" type="text/javascript" charset="utf-8"></script> <link rel="alternate" title="Feed" href="data/feed.xml" type="application/rss+xml" /> <link rel="icon" href="data/logo-favicon.png" type="image/png" /> <link rel="shortcut icon" href="data/logo-favicon.png" type="image/png" /> </head> <body id="docs"> <a class="skip" name="top"> </a> <a class="skip" href="#content">Skip to content</a> <div id="head"> <div id="logo"> <h1><a href="index.html"><img src="data/logo-head.png" alt="logo" /> anyRemote</a></h1> </div> <div id="navigation"><div class="padding"> <a href="index.html"><span>About</span></a> <a href="frontend.html"><span>Screenshots</span></a> <a href="dload.html"><span>Download</span></a> <a href="docs.html" class="active"><span>Documentation</span></a> <a href="faq.html"><span>FAQ</span></a> <a href="contacts.html"><span>Contact</span></a> <a href="thanks.html"><span>Special Thanks</span></a> </div></div> </div> <div id="sidebar"><div class="padding"> <dl class="info"> <dt>Information</dt> <dd> <p>Please use the two sidebar boxes below to browse through the anyRemote Documentation!</p> </dd> </dl> <dl class="docs"> <dt>Documentation</dt> <dd> <ul> <li><a href="pre-setup.html">Before install</a></li> <li><a href="pre.html">Software prerequisites</a></li> <li><a href="install.html">Compilation and installation</a></li> <li><a href="mode.html">Which mode to choose ?</a></li> <li><strong>Setup</strong> <ul> <li><a href="setup-at.html">Setup: AT mode</a> <ul> <li><a href="event.html">Event reporting</a></li> <li><a href="ckpd-emulation.html">Keypad emulation events</a></li> </ul> </li> <li><a href="setup-server.html">Setup: Server mode</a></li> </ul> </li> <li><a href="use.html">How to use anyRemote</a> <ul> <li><a href="use-jc.html">Java Client</a></li> <li><a href="web.html">Web Interface</a></li> <li><a href="cfg-howto.html">How to create simple configuration file</a></li> <li><a href="bemused.html">Bemused Support</a></li> </ul> </li> <li><a href="devices.html">Tested devices</a></li> <li><a href="phones.html">Phone specific details</a></li> <li><a href="tips-tricks.html">Tips & tricks</a></li> <li><a href="man.html">Man page</a></li> </ul> </dd> </dl> <dl class="docs-advanced"> <dt>Advanced</dt> <dd> <ul> <li><a href="http://elpraga.googlepages.com/HOWTOstartanyRemoteatboottime.html">miniHOWTO: start anyRemote at boot time and create a multimedia computer</a> (externally maintained)</li> <li><strong>Format of configuration files</strong> <ul> <li><strong>Server mode</strong> <ul> <li><a href="conf-server.html">Configuration file format</a></li> <li><a href="conf-server-ex.html">Configuration file examples</a></li> <li><a href="set.html">Set(...) / ExecAndSet(...) commands</a></li> <li><a href="set-fm.html">Set(filemanager ... ) command</a></li> <li><a href="set-icons.html">Set(icons ...) command and available icon set</a></li> <li><a href="set-list.html">Set(list ... ) and Set(iconlist ... ) commands</a></li> <li><a href="set-menu.html">Set(menu ... ) command</a></li> <li><a href="set-parameter.html">Set(parameter, ... ) commands</a></li> <li><a href="set-text.html">Set(text ... ) command</a></li> <li><a href="set-window.html">Set(image ... ) command</a></li> </ul> </li> <li><strong>AT mode</strong> <ul> <li><a href="conf-at.html">Configurational file format</a></li> <li><a href="conf-at-ex.html">Configurational file examples</a></li> </ul> </li> <li><strong>Common</strong> <ul> <li><a href="make.html">Make(...) command</a></li> <li><a href="emulate.html">Emulate(...) command</a></li> <li><a href="vars.html">Variable substitution</a></li> <li><a href="ev-handlers.html">Event handlers</a></li> <li><a href="icon-themes.html">Icon themes for java client</a></li> </ul> </li> </ul> </li> <li><a href="dcop.html">DCOP support by kAnyRemote</a></li> <li><a href="ir.html">anyRemote and InfraRed</a></li> </ul> </dd> </dl> <dl class="contact"> <dt>Contact</dt> <dd> <p>We will be pleased for any questions, suggestions, patches and examples of configuration files!</p> <ul> <li>Post in the <a href="http://sourceforge.net/forum/?group_id=162923">Forum</a></li> <li>Please, send e-mails to <a href="mailto:anyremote@mail.ru">anyremote@mail.ru</a></li> </ul> </dd> </dl> <!--HOSTINGLOGO--> </div></div> <!-- sidebar --> <div id="content"><div class="padding"> <a class="skip" name="content"> </a> <h1>Configuration file format: Server mode</h1> <h2>Configuration file examples</h2> <p>You may find some predefined <a href="conf-server-ex.html">configuration files</a> in cfg-data/Server-mode and cfg-data/Bemused-emulation directories. After investigation of these configuration files You became more familiar with its format.</p> <h2>Format</h2> <p>Line starting with a <strong>%</strong> considered as a comment line.</p> <pre>%This is a comment</pre> <p>Long command can be splitted into the several lines. You have to put backslash (<strong>\</strong>) as the <strong>last</strong> character to continue a command to the next line.</p> <pre>1=Exec(echo "this is first line");\ Exec(echo "this is second line");</pre> <h2>Parameters section</h2> <p><strong>AutoRepeat=false</strong></p> <p>Auto repeat feature (as on PC keyboard - about 10 events per second). Usefull for mouse emulation, for example. Default value is false.</p> <p><strong>Baudrate=19200</strong></p> <p>Baudrate to use; default value is 19200</p> <p><strong>Device=bluetooth:19</strong></p> <p>Connect string. Default value is bluetooth:19.</p> <p>If anyRemote works as server correct value for <strong>Device</strong> could be:</p> <ul> <li><strong>Device=bluetooth:"channel"</strong>or just <strong>Device=bluetooth</strong> (to choose first available channel).</li> <li><strong>Device=socket:"port"</strong></li> <li><strong>Device=ilirc:/path/to/socket_file</strong></li> <li><strong>Device=local:/dev/ircommX</strong></li> <li><strong>Device=stdin</strong></li> </ul> <p><strong>Log=true|false|debug</strong></p> <p>Print or not to print logging info to the file <i>$HOME/.anyRemote/anyremote.log</i>, default value is false. Use <i>Log=debug</i> for verbose logging.</p> <p>By default all logging informationin will be stored in <i>$HOME/.anyRemote/anyremote.log</i> file. This could be altered by setting <i>AR_TMPDIR</i> environment variable. If <i>AR_TMPDIR</i> environment variable is set then logging information will be printed to <i>${AR_TMPDIR}/anyremote.log.${USER}</i></p> <p><strong>Screen=true</strong></p> <p>Send or don't send any commands (Set(status,...), Set(title,...), etc.) to the phone. Default value is false.</p> <p><strong>GuiAppName="application name"</strong></p> <p><strong>GuiAppBinary="name of executable"</strong></p> <p><strong>GuiAppRun="command do determine is application running or not; must returns OK or NOK"</strong></p> <p><strong>GuiAppIcon="icon name"</strong></p> <p><strong>GuiAppType=Application|Custom|Example</strong></p> <p><strong>GuiAppModes=Server|AT|Bemused</strong></p> <p><strong>GuiAppDesc=Some text</strong></p> <p>These parameters is used by GUI frontends only.</p> <pre>GuiAppName=Amarok GuiAppBinary=amarok GuiAppRun=echo 'A=`dcop | grep amarok`; if [ "x$A" == "x" ]; \ then echo NOK; else echo OK; fi'|bash -f -s GuiAppIcon=amarok.png GuiAppType=Application GuiAppModes=Server GuiAppDesc=Application decription</pre> <h2>[Aliases] section</h2> <p><strong>Format:</strong></p> <p><strong>Key_Code=New_alias</strong></p> <p>Different phones uses the different keycodes, for example: Button 1 on Motorola generates keycode 1 but the same button on Sagem generates keycode 49. So, if You plans to use this tools with different phones, it could be useful to redefine:</p> <pre>1=One 49=One</pre> <p>and then use "One" in <strong>[Keys]</strong> section instead of "1" or "49":</p> <pre>[Keys] One=Exec(echo "Hello world!"); ...</pre> <h2>[Keys] section</h2> <p> A short example:</p> <pre>[Keys] (Init)=Exec(kdialog --msgbox "Initialized"); (InCall)=Exec(kdialog --msgbox "A call from $(CallId)");\ Make(remote,off); (EndCall)=Make(remote,on);Exec(kdialog --msgbox CALL_END) (Connect)=Exec(kdialog --msgbox "Connected") (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]</pre> <h3>Format:</h3> <p><strong>Key_Codes=Command1;Command2;Command3;....</strong></p> <p>Where <strong>CommandX</strong> could be:</p> <ul> <li>Exec(...);</li> <li><a href="emulate.html">Emulate(...);</a></li> <li>Exit;</li> <li>Macro(...);</li> <li><a href="make.html">Make(...);</a></li> <li><a href="set.html">Set(...);</a></li> <li><a href="set.html">ExecAndSet(...);</a></li> <li>Timer(...);</li> <li>Load(...);</li> <li>Include(...);</li> <li>Send(...);</li> <li>ExecAndSend(...);</li> <li>Get(...);</li> <li>End();</li> </ul> <h3>Exec() command</h3> <pre>1=Exec(kdialog --msgbox 1) 2=Exec(kdialog --msgbox 2)</pre> <p>It is possible to define multi-key commands</p> <pre>3 1=Exec(kdialog --msgbox 3_1) 3 2=Exec(kdialog --msgbox 3_2) 3 3 1=Exec(kdialog --msgbox 3_3_1)</pre> <p>It is not good idea to define:</p> <pre>3 3=Exec(kdialog --msgbox 3_3) 3 3 1=Exec(kdialog --msgbox 3_3_1)</pre> <p>simultaneously, since only one command will works (which one - depends on search order).</p> <p>It is possible to group keymappings in so-called "mode" to set more than one command to the key:</p> <pre>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]</pre> <p>If current mode is not default mode <i>(see <strong><a href="make.html">Make(mode ...);</a></strong> command)</i>, 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) <a href="ev-handlers.html">"events"</a> very carefully in default mode.</p> <p>It is possible to write quite complex commands inside <strong>Exec()</strong>, for example:</p> <pre>1=Exec(echo 'D=`dcop | grep digikam`;\ if [ "x$D" == "x" ]; then digikam \ else dcop $D MainApplication-Interface quit;' | bash -f -s)</pre> <h3>Macro() command</h3> <p>This command used to create new keymapping:</p> <pre>1=Macro(Macro1) Macro1=Exec(kdialog --msgbox 1);Exec(kdialog --msgbox 2)</pre> <p>Macro() command can contain condition:</p> <pre>1=Macro(Macro2, if [ -f /tmp/file_name ];\ then true; else false; fi; echo $?) Macro2=Exec(kdialog --msgbox "Condition is OK")</pre> <p>Conditional Macro() will be execute only if a result of execution of command is equal to string "<strong>0</strong>".</p> <p><strong>Note</strong>: In shells result code of command execution stored in <strong>$?</strong> environment variable.</p> <h3>Set() command</h3> <p>These commands used to control and customize GUI of Java client. See detailed description <a href="set.html">here.</a></p> <p>It is possible to change:</p> <ul> <li>caption of screen</li> <li>title and status fields</li> <li>arrange icons from predefined <a href="set-icons.html">icon set</a>,</li> <li>change background and foreground color,</li> <li>change font size</li> <li>change icon layouts (skins)</li> <li>use internal vibrator of the phone</li> <li>set fullscreen mode</li> <li>set debug mode</li> <li><a href="set-text.html">show text</a> on the screen of cell phone</li> <li><a href="set-list.html">show list</a> on the screen of cell phone</li> <li>add custom <a href="set-menu.html">menus</a></li> </ul> <table border="0" cellspacing="0" rules="rows" class="no-padding"> <tr> <td style="vertical-align: top; text-align: center;"> <img src="data/client-test.png" border="1" alt="Example of how java client can looks" /> </td> <td style="vertical-align: top; text-align: center;"> <img src="data/jc/fileManager2.png" border="1" alt="Example of how java client can looks" /> </td> </tr> </table> <h3>ExecAndSet() command</h3> <p>Format: ExecAndSet(tag,command)</p> <p>This command similar to the Set(), but uses the output of command specified as a string to set GUI elements of Java client specified in tag field. See detailed description <a href="set.html">here.</a></p> <pre>5=ExecAndSet(title,dcop amarok player nowPlaying); 6=ExecAndSet(status,date)</pre> <h3>Timer()</h3> <p>Format:</p> <p><strong>Timer(key, timeout, maxTimes)</strong> or</p> <p><strong>Timer(key, cancel|pause|continue|reset|restart)</strong></p> <p>This command sets/removes a timer for the <strong>key</strong> specified. A command sequence, associated with this <strong>key</strong> will be executed periodically.</p> <p>For example, the following commands run 'dcop amarok player nowPlaying' command 2 times with timeout equal to 5 sec and set result to the title field of Java client:</p> <pre>1=Timer(TimerCmd, 5, 2) TimerCmd=ExecAndSet(title, dcop amarok player nowPlaying)</pre> <p>The following command run 'date' command every 10 sec and set result to the status field of Java client:</p> <pre>2=Timer(Timer2, 10, 0) Timer2=ExecAndSet(status, date)</pre> <p>It is impossible to have two active timer commands with the same <strong>key</strong>.</p> <p>To delete existing timer use the following command:</p> <pre>3=Timer(TimerName,cancel)</pre> <p>To reset timer use the following command:</p> <pre>4=Timer(TimerName,reset)</pre> <p>To completely restart timer use the following command:</p> <pre>5=Timer(TimerName,restart)</pre> <p>This command resets timer and resets counter of timer's executions</p> <p>Also, see <a href="set.html#data-caching">note</a> about data caching.</p> <h3>Load() command</h3> <p>This command used to load commands from file and execute them:</p> <pre>1=Load(file_name.cmds)</pre> <h3>Include() command</h3> <p>This command used to include definitions from external configuration file:</p> <pre>1=Include(xmms.cfg)</pre> <p>Only [Keys], [Aliases] and [Alarms] sections will be loaded (Parameters section will not be loaded). Definitions from included file will not rewrite any of existing definitions.</p> <h3>Send() command</h3> <p>Format:</p> <p><strong>Send(string, string_value)</strong> or</p> <p><strong>Send(byte, byte_value1, byte_value2,...)</strong></p> <p>Sends to the Java client specified string or sequence of bytes. This command is used in Bemused server emulation.</p> <pre>1=Send(string, simple_string)</pre> <p>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.</p> <pre>2=Send(bytes,35,42,0)</pre> <h3>ExecAndSend() command</h3> <p>Format:</p> <p><strong>ExecAndSend(tag,command)</strong></p> <p>This command similar to the Send(tag, ...), but uses the output of command specified as a string to send. So, it is possible to execute dynamically created command. This command is used in Bemused server emulation.</p> <pre>3=ExecAndSend(string,date) 4=Exec(echo "Set(title,dynamic title)">/tmp/command.txt);\ ExecAndSend(string,cat /tmp/command.txt)</pre> <a name="sec-get"></a> <h3>Get() command</h3> <p>Format:</p> <p><strong>Get(screeen_size|cover_size|model|version|cursor|password|ping)</strong> or</p> <p><strong>Get(is_exists,16|32|64,_icon_name_)</strong></p> <p>This command used to retrieve from phone some information.</p> <pre>3=Get(screeen_size) 4=Get(model) 5=Get(is_exists,16,next) 6=Get(cover_size) 7=Get(version) 8=Get(cursor) 9=Get(ping) 0=Get(password)</pre> <p><strong>Get(screeen_size)</strong> used to get screen size of cell phone. As a response to this command two replies will be send: <strong>SizeX(width,)</strong> and <strong>SizeY(height,)</strong>. SizeX(width,) reply will be the first one.</p> <p><strong>Get(model)</strong> used to get "microedition.platform" property of Java client. For many phones this property contains manufacturer and model number (like "SonyEricssonK750i/R1CA021" for SE-K750). As a response to this command <strong>Model(,_string_)</strong> reply will be sent.</p> <p><strong>Get(is_exists,...)</strong> used to determine was icon with given name and size uploaded to phone or not. As a response to this command <strong>IconExists(_icon_name_,)</strong> or <strong>IconNotExists(_icon_name_,)</strong> reply will be send.</p> <p><strong>Get(cover_size)</strong> used to determine maximalsize of cover image which can be shown by <strong>Set(cover, ...)</strong> command. As a response to this command one reply will be send: <strong>CoverSize(_size_,)</strong></p> <p><strong>Get(version)</strong> used to retrieve java client version. As a response to this command <strong>Version(,_version_)</strong> reply will be sent.</p> <p><strong>Get(cursor)</strong> user to determine cursor position on <a href="set-window.html">Image screen</a> of java client. Two replies <strong>PosX(x_coord,)</strong> and <strong>PosY(y_coord,)</strong> will be sent. PosX() event will be first one. If current screen of java client is not <a href="set-window.html">Image screen</a> then no replies will be sent.</p> <p><strong>Get(ping)</strong> user to send "keepalive" messages to java client. As a response to this command <strong>Ping</strong> reply will be sent.</p> <p><strong>Get(password)</strong> user to ask password from java client. As a response to this command <strong>_PASSWORD_(,_password_)</strong> reply will be sent. This reply handled by anyRemote internally, so generally users should not worry about it.</p> <p>Password should be stored in <strong>$HOME/.anyRemote/password</strong> file in a plain text.</p> <h3>End() command</h3> <p>Format:</p> <p><strong>End()</strong></p> <p>This command used only if <strong>-http</strong> command line option is used. This commmand used internally and should not be used in configuration files. The purpose of the command is to inform <strong><a href="web.html">anyremote2html</a></strong> about fact what command sequence is finished.</p> <h3>Make() command</h3> <p>Format:</p> <p><strong>Make(flush|disconnect|mode|remote|var[,....])</strong></p> <p>This command used control local state of anyRemote.</p> <pre>0=Make(flush) 1=Make(mode,mode_2) 2=Make(remote,on) 3=Make(var,my_var,date)</pre> <p>See detailed description <a href="make.html">here</a>.</p> <h3>Event handlers</h3> <p>There are several "events" could be triggered. See <a href="ev-handlers.html">Event handlers</a> page for details.</p> <h3>Variable substitution</h3> <p>In Exec(), Make(var,...), Load(), Include() commands is it possible to use internal "variables". See <a href="vars.html">Variable substitution</a> page for details.</p> <h2>[Alarms] section</h2> <p>Format:</p> <p><strong>Alarm_file=command1;command2;...</strong></p> <p>When file Alarm_file will be created, then command1, command2 ... will be executed.</p> <pre>/tmp/alarm1=Set(status,"xmms was stopped")</pre> </div></div> <!-- content --> <div id="foot"> <p>Maintained by <a href="mailto:anyremote@mail.ru">anyRemote</a>. Website by <a href="http://www.martinlettner.info">m.lettner</a>.</p> </div> </body> </html>