<!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="android-client.html">Android Client</a></li> <li><a href="use-jc.html">J2ME Client</a></li> <li><a href="web.html">Web Interface</a></li> <li><a href="cm-xml.html">XML Services 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> <li><a href="iviewer.html">Command Fusion iViewer 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.bshellz.net/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="dbus.html">Dbus(...) 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 J2ME client</a></li> </ul> </li> </ul> </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> <dl class="help"> <dt>Project needs help!</dt> <dd>Help us to fix any misprintings, syntax and stylistic errors in documentation. Send Your corrections to <a href="mailto:anyremote@mail.ru">anyremote@mail.ru</a></dd> </dl> <!--HOSTINGLOGO--> </div></div> <!-- sidebar --> <div id="content"><div class="padding"> <a class="skip" name="content"> </a> <h1>How to create simple configuration file</h1> <h2>Configuration file examples</h2> <p>You may find predefined configuration files in <strong>cfg-data</strong> directory. Firstly, take a look to the simple configuration file like <strong>cfg-data/Server-mode/template-player.cfg</strong>. After investigation of some configuration files You'll became more familiar with its format.</p> <h2>How To</h2> <h3>Specify keys to handle</h3> <p>A short example, which:</p> <ul> <li>Shows popup message if button <strong>1</strong> pressed.</li> <li>Show "Hello" string in title field of anyRemote client if button <strong>2</strong> pressed. <em>Valid in Server mode.</em></li> <li>Set current time to the status field of anyRemote client if button <strong>3</strong> pressed. <em>Valid in Server mode.</em></li> </ul> <pre>[Protocol]=Server 1=Exec(kdialog --msgbox "Hello!") 2=Set(title,"Hello!") 3=ExecAndSet(status,date +"%M:%S") ...</pre> <p><strong>Exec()</strong> command is the mostly used one. It is used to run specified command.</p> <p><strong><a href="set.html">Set()/ExecAndSet()</a></strong> commands used to control look and behavour of the client, which is used in Server mode.</p> <p> To make custom setup of the clients main window upon connection:</p> <pre>(Connect)=\ Set(<a href="set-icons.html">icons</a>,TheTitle,\ 1,vol_down,2,mute,3,vol_up,\ 4,rewind,5,play,6,forward,\ 7,prev,8,pause,9,next,\ *,question,0,stop,#,quit);\ Set(<a href="set.html">status</a>,Connected now);\ Set(<a href="set.html">title</a>,Hello!);</pre> <p>As You can see it is possible to execute more than one command at once.</p> <p>At the end, another "almost" real Server mode example which contols <a href="http://amarok.kde.org/">Amarok/KDE3</a> player:</p> <pre>[Protocol]=Server % Run amarok when connected (Connect)=Exec(amarok); % 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); [End]</pre> <p>Lines starting with <strong>%</strong> are considered as a comment.</p> <h3>Notes</h3> <p>anyRemote uses <a href="http://linux.die.net/man/3/popen">popen</a> system call in Exec() command. This means that command will be executed inside <strong>/bin/sh</strong> command interpreter.</p> <p>It is suggested to avoid explicit usage of other shells, like <a href="http://linux.die.net/man/1/bash">bash</a> or <a href="http://linux.die.net/man/1/ksh">ksh</a> in configuration files. Please keep in mind that some embedded systems like <a href="https://openwrt.org/">OpenWrt</a> does not contains such packages by default.</p> <p> </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>