anyRemote · Control your computer with your phone
Description: anyRemote project page - Bluetooth remote control tool

Skip to content

# anyRemote

# Tips & tricks

## Enhance security with password

In Server-mode it is possible to set password which will be requested from J2ME/Android clients.

To make this it needs to run anyRemote with -password commandline option.

The password phrase should be stored in $HOME/.anyRemote/password file in a plain text.

## Keepalive messages

If J2ME/Android client on the phone disconnects from PC after some inactivity period it is possible to send keepalive messages to handle this. It just needs to add command like

    Timer(_PING_,300,0);

to the $HOME/.anyRemote/hook_connect file and add command

    Timer(_PING_,cancel);

to the $HOME/.anyRemote/hook_disconnect file.

In the line above 300 is a number of seconds between Get(ping) requests.

## Customization of client initialization/exiting and connect/disconnect commands.

It is possible to add custom commands to (Init), (Connect), (Disconnect) and (Exit) event handlers.

To do this it needs to create file

- $HOME/.anyRemote/hook_int (for (Init) event handler)
- $HOME/.anyRemote/hook_connect (for (Connect) event handler)
- $HOME/.anyRemote/hook_disconnect (for (Disconnect) event handler)
- $HOME/.anyRemote/hook_exit (for (Exit) event handler)

and put all needed commands there. That commands will be executed after commands defined in appropriate event handler command sequence.

## Support for non-UTF8 encodings

Anyremote J2ME client supports only UTF8 encoding. If You system configured to use other encoding (e.g ISO-8859-15 used in Western Europe) then it is possible to handle this.

It needs to define variable $(FromEncoding) and add command like

    Make(var,FromEncoding,by_value,ISO-8859-15);

to the $HOME/.anyRemote/hook_init file.

Conversion from specified encoding to UTF8 will be automatically applied to the following commands:

    ExecAndSet(list,add|replace,...);
    ExecAndSet(iconlist,add|replace,...);
    ExecAndSet(filemanager,add|replace,left|right...);

Reverse conversion to specified encoding from UTF8 will be automatically applied to the $(Param) environment variable.

Note: Be sure iconv library is installed in You system.

Note: anyRemote should be compiled with iconv support.

## Volume control with amixer or pacmd utilities.

If managed application does not allow to control volume, then anyRemote will use ALSA or PulseAudio directly. And using of the PulseAudio will be a preferred.

In this case it needs to have amixer or pacmd utilities installed on Your system.

By default anyRemote will control

- Master channel of soundcard #0 in case of ALSA
- Default Sink in case of PulseAudio

If it needs to control sound volume with non-default parameters, it is possible to add definitions of the following variables

- $(default_mixer_up)
- $(default_mixer_down)
- $(default_mixer_mute)
- $(default_mixer_get)
- $(default_mixer_set)

to the $HOME/.anyRemote/hook_init file.

For example, default setup for ALSA:

    Make(var,default_mixer_up,by_value,amixer sset Master,0 5%+ -q);
    Make(var,default_mixer_down,by_value,amixer sset Master,0 5%- -q);
    Make(var,default_mixer_mute,by_value,amixer sset Master,0 toggle -q);
    Make(var,default_mixer_get,by_value,amixer sget Master,0|\
                            grep '\['|head -1|cut -f 2 -d "["|cut -f 1 -d "]"|sed "s/%//");
    Make(var,default_mixer_set,by_value,amixer -q sset Master,0 );

or default setup for PulseAudio:

    Make(var,default_sink,LANG=C;pactl stat|grep "Default Sink"|cut -f 2 -d ":"|tr -d ' ');
    Make(var,default_mixer_down,by_value,$(CfgDir)/Utils/pulse-audio-ctl.sh down $(default_sink));
    Make(var,default_mixer_up,by_value,$(CfgDir)/Utils/pulse-audio-ctl.sh up $(default_sink));
    Make(var,default_mixer_mute,by_value,$(CfgDir)/Utils/pulse-audio-ctl.sh mute $(default_sink));
    Make(var,default_mixer_get,by_value,$(CfgDir)/Utils/pulse-audio-ctl.sh get $(default_sink));
    Make(var,default_mixer_set,by_value,$(CfgDir)/Utils/pulse-audio-ctl.sh set $(default_sink) );

## Power Management

By default anyRemote will use

- poweroff command to switch off computer
- dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend command to suspend computer

In Ubuntu pmi utility is available in powermanagement-interface package and it is possible to use pmi action suspend command to suspend computer.

If it needs to change default power management parameters, it is possible to add definitions of the following variables

- $(default_switch_off)
- $(default_suspend)

to the $HOME/.anyRemote/hook_init file.

For example:

    Make(var,default_switch_off,by_value,poweroff);
    Make(var,default_suspend,by_value,pmi action suspend);

## Cover Art support by audio player configuration files.

If anyRemote can not retrieve cover art from application, it try to search it inside directory with file currently played. (search done with depth equal to 2). It is user responsibility to store cover art in appropriate directory.

Maintained by anyRemote. Website by m.lettner.