There are several "events" could be triggered
Initialize event
(Init) event will be fired when anyRemote is initialized.
(Init)=Exec(kdialog --msgbox "Initialized")
It is possible to customize handling of (Init) event. To do this, just add needed commands to $HOME/.anyRemote/hook_init file. That commands will be executed after all commands from (Init) event handler in configuration file. For example content of the $HOME/.anyRemote/hook_init can be the following:
Exec(kdialog --msgbox "Initialized")
Exit event
(Exit) event will be fired when anyRemote is exiting.
(Exit)=Exec(rm -f /tmp/tmp.log)
It is possible to customize handling of (Exit) event. To do this, just add needed commands to $HOME/.anyRemote/hook_exit file. That commands will be executed after all commands from (Exit) event handler in configuration file. For example content of the $HOME/.anyRemote/hook_exit can be the following:
Exec(kdialog --msgbox "Exiting")
Connect event
(Connect) event will be fired when connection established.
(Connect)=Exec(kdialog --msgbox "Connected now")
It is possible to customize handling of (Connect) event. To do this, just add needed commands to $HOME/.anyRemote/hook_connect file. That commands will be executed after all commands from (Connect) event handler in configuration file. For example content of the $HOME/.anyRemote/hook_connect can be the following:
Exec(kdialog --msgbox "Connected")
Disconnect event
(Disconnect) event will be fired if connection is lost.
(Disconnect)=Exec(kdialog --msgbox Disconnected)
It is possible to customize handling of (Disconnect) event. To do this, just add needed commands to $HOME/.anyRemote/hook_disconnect file. That commands will be executed after all commands from (Disconnect) event handler in configuration file. For example content of the $HOME/.anyRemote/hook_disconnect can be the following:
Exec(kdialog --msgbox "Disconnected")
Auto-lock example
(Connect)=Exec(killall kdesktop_lock) (Disconnect)=Exec(kdesktop_lock --forcelock)
Mode changing events
Mode is a group of key-to-command mapping (do not mix this with AT/Server mode !).
If mode is changed by Make(mode ...); then (ExitMode) event for current keymapping group and (EnterMode) event for the new keymapping group will be fired:
*=Make(mode,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)
[ModeEnd]
Phone call handling
Note for Server mode: This feature can not work for some of Android or JSR-82 capabled phones. It was tested successfully only with SE-K750 and Motorola-RIZR-Z3.
Incoming call
InCall($$)=Exec(kdialog --msgbox "Incoming call from $(Param)")
$(Param) variable will be set to caller ID, if determined.
Answering the call
[Android client only].
AnwerCall($$)=Exec(kdialog --msgbox "Answer to call from $(Param)")
$(Param) variable will be set to caller ID, if determined.
End of call
EndCall($$)=Exec(kdialog --msgbox "Call finished")
Auto-mute example (amixer utility should be installed):
InCall($$)=\
Exec(amixer sset Master,0 mute);Make(remote,off);
EndCall($$)=\
Make(remote,on);Exec(amixer sset Master,0 unmute)
anyRemote