[qtmoko] running a script once usb-connection is detected

robin spielraum at web.de
Tue Mar 4 20:16:28 CET 2014


hi,

thanks to radek I am now able to launch the voicerecorder from the aux 
button (see bellow).

now I would like the recordings to be processed as soon as the phone 
realises that it has an internet connection via usb. can anyone help me
if either there is a script which polls for the usb-connection where I 
could insert another command or what other solutions there might be.

what I would like to do in the end is to be able
a) to quickly record a messege (DONE)
aI) increase recording volume just for the message (??)
b) once I have an internet connection have the message translated by an 
online service
c) add a section to my orgmode notes file with the translated message
and, a link to the original wav file in case the translation is not 
good enough, and another link to a script which removes the file, once 
I do not need it anymore.

best regards

robin




ps @ radek: what does the Suspend.service actually launch so you get the
shutdown/restart menu?

[Translation]
File=QtopiaServices
Context=Service:Name
[Service]
Icon=light-and-power/Light
Name[]=Media Session

/qtmoko/services/VoiceRecording/





---------------- CHANGING DEFAULT BEHAVIOUR OF THE AUX BUTTON ------
nano /opt/qtmoko/etc/defaultbuttons.conf 

[Button0]
HeldActionMessage=showRunningTasks()
HeldActionService=TaskManager
Key=F7
Name=Button
PressedActionMessage=toggleRecording()
PressedActionService=VoiceRecording


the command is toggleRecording()
you find it here:
nano /opt/qtmoko/services/VoiceRecording.service 

[Translation]
File=QtopiaServices
Context=Voice Recorder
[Service]
Actions = "toggleRecording();recordAudio(QDSActionRequest)"
Icon = recordaudio
Name[]=Record
[toggleRecording()]
Icon = recordaudio
Name[]=Record Audio





More information about the community mailing list