From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Jones Subject: Re: MobileOrg and Voice Capturing (Android) Date: Tue, 7 Dec 2010 11:34:21 -0500 Message-ID: References: <87fwul463g.fsf@gmx.ch> <4CF46B08.2020200@comcast.net> <87d3plotiv.fsf@gmx.ch> <4CF6FBF0.1090707@comcast.net> <874oawppqa.fsf@gmx.ch> <4CF7F014.7080203@comcast.net> <4CF8210A.8020705@comcast.net> <87sjy9oq2u.fsf@gmx.ch> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0577809610==" Return-path: Received: from [140.186.70.92] (port=46727 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQ0V4-0006Te-5k for emacs-orgmode@gnu.org; Tue, 07 Dec 2010 11:34:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQ0V1-0002rV-I3 for emacs-orgmode@gnu.org; Tue, 07 Dec 2010 11:34:46 -0500 Received: from mail-qy0-f176.google.com ([209.85.216.176]:44066) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQ0V1-0002rP-Bh for emacs-orgmode@gnu.org; Tue, 07 Dec 2010 11:34:43 -0500 Received: by qyk10 with SMTP id 10so101174qyk.0 for ; Tue, 07 Dec 2010 08:34:42 -0800 (PST) In-Reply-To: <87sjy9oq2u.fsf@gmx.ch> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sven Bretfeld Cc: emacs-orgmode@gnu.org --===============0577809610== Content-Type: multipart/alternative; boundary=00163646bf8ade20b50496d494ee --00163646bf8ade20b50496d494ee Content-Type: text/plain; charset=ISO-8859-1 Hi Sven... that's a nice one, you might could add that to the scripts section of the MobileOrg wiki. Pretty soon the Capture interface will be extended to allow settings tags and other things on captured notes... once these are in place I will extend the CAPTURE action to also take these values as intent params. http://matburt.net On Tue, Dec 7, 2010 at 5:05 AM, Sven Bretfeld wrote: > Hi Matthew > > Matthew Jones writes: > > > Alright guys, I've gotten this to work.... I've posted an early build of > > MobileOrg that supports this here: > > > > http://matburt.net/files/mobileorg-debug.apk > > > > basically, you need to emit the action: com.matburt.mobileorg.CAPTURE > > > > it takes an "extra" intent value called "txtValue" which will > pre-populate the > > text display. > > I was using the script for some days now and did all my capturing this > way. It is completely stable and reliable on my HTC Magic with Android > 1.6. I see no hindrance for a release. > > > import android > > droid = android.Android() > > message = droid.recognizeSpeech("Capture New Note").result > > a = droid.startActivity("com.matburt.mobileorg.CAPTURE", None, None, > > {'txtValue':message}, False) > > Is there a way to enlarge the 'extra' intent with some standard string? > It would be nice to have a TODO keyword and a TAG inserted > automatically. If you are like me, you tend to forget refiling the items > of from-mobile.org regularly. An automatic TAG insertion could help to > remind yourself that there is something new that needs to be cared > about. I use to give a TAG :MIT: (Most Important Things [of the day]) > and have a respective Agenda View that I review several times a day. If > newly captured items could appear in this list, I would never forget > about the newly captured tasks. To my regret, I don't know anything > about Python and its syntax, but I'm sure that the 'message' variable > can be extended easily (what I have tried did never work). > > As a workaround I have written a simple shellscript for a Cronjob that > starts Conky whenever there is something new in from-mobile.org. So my > desktop reminds me to refile the new items. Maybe it is of some interest > for anybody, so I give it below. > > Thanks again for your nice work. > > Greetings, > > Sven > > > Here is the Script. Some values and paths have to be replaced to fit > your needs: > > --8<---------------cut here---------------start------------->8--- > #!/bin/bash > > KILLNR="$(ps ax | grep "conky -c .*conkyrc-mobile" | grep -v grep | sed 's/ > pts.*//g')" > NEWTASK="$(cat /home/sven/Dropbox/myconf/from-mobile.org | grep -v > auto-revert | grep -v ^$ | grep -v 20[0-9][0-9])" > > if [ -n "$NEWTASK" ]; > then > if [ -n "$KILLNR" ]; > then > exit > # echo "file is full, conky is running" > else > conky -c ~/.conkyrc-mobile & > # echo "file is full, conky is not running" > fi > else > if [ -n "$KILLNR" ]; > then > kill $KILLNR > # echo "file is empty, conky is running" > else > exit > # echo "file is empty, conky is not running" > fi > fi > --8<---------------cut here---------------end--------------->8--- > > This script needs a special configuration file .conkyrc-mobile to be > placed in the home folder: > > --8<---------------cut here---------------start------------->8--- > own_window yes > own_window_type override > own_window_transparent yes > own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager > > use_spacer right > > use_xft yes > xftfont DejaVu Sans:size=18 > xftalpha 0.8 > text_buffer_size 2048 > > update_interval 3.0 > > draw_shades no > > draw_outline no > draw_borders no > uppercase no > > stippled_borders 3 > > border_margin 9 > > border_width 10 > > default_color grey > > own_window_colour brown > own_window_transparent yes > > alignment top_right > > gap_x 10 > gap_y 10 > > TEXT > $color > > ${Color green}NEW TASKS > ${execi 10 cat /home/sven/Dropbox/myconf/from-mobile.org | grep -v > auto-revert | grep -v ^$ | grep -v 20[0-9][0-9]}$color > --8<---------------cut here---------------end--------------->8--- > --00163646bf8ade20b50496d494ee Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Sven... that's a nice one, you might could add that to the scripts s= ection of the MobileOrg wiki.

Pretty soon the Capture in= terface will be extended to allow settings tags and other things on capture= d notes... once these are in place I will extend the CAPTURE action to also= take these values as intent params.

htt= p://matburt.net


On Tue, Dec 7, 2010 at 5:05 AM, Sven Bre= tfeld <sven.br= etfeld@gmx.ch> wrote:
Hi Matthew

Matthew Jones <bsdmatburt@gmail.= com> writes:

> Alright guys, I've gotten this to work....= I've posted an early build of
> MobileOrg that supports this here:
>
> http://matburt.net/files/mobileorg-debug.apk
>
> basically, you need to emit the action: com.matburt.mobileorg.CAPTURE<= br> >
> it takes an "extra" intent value called "txtValue"= which will pre-populate the
> text display.

I was using the script for some days now and did all my capturing thi= s
way. It is completely stable and reliable on my HTC Magic with Android
1.6. I see no hindrance for a release.

> import android
> droid =3D android.Android()
> message =3D droid.recognizeSpeech("Capture New Note").result=
> a =3D droid.startActivity("com.matburt.mobileorg.CAPTURE", N= one, None,
> {'txtValue':message}, False)

Is there a way to enlarge the 'extra' intent with some standa= rd string?
It would be nice to have a TODO keyword and a TAG inserted
automatically. If you are like me, you tend to forget refiling the items of from-mobile.org= regularly. An automatic TAG insertion could help to
remind yourself that there is something new that needs to be cared
about. I use to give a TAG :MIT: (Most Important Things [of the day])
and have a respective Agenda View that I review several times a day. If
newly captured items could appear in this list, I would never forget
about the newly captured tasks. To my regret, I don't know anything
about Python and its syntax, but I'm sure that the 'message' va= riable
can be extended easily (what I have tried did never work).

As a workaround I have written a simple shellscript for a Cronjob that
starts Conky whenever there is something new in from-mobile.org. So my
desktop reminds me to refile the new items. Maybe it is of some interest for anybody, so I give it below.

Thanks again for your nice work.

Greetings,

Sven


Here is the Script. Some values and paths have to be replaced to fit
your needs:

--8<---------------cut here---------------start------------->8---
#!/bin/bash

KILLNR=3D"$(ps ax | grep "conky -c .*conkyrc-mobile" | grep = -v grep | sed 's/ pts.*//g')"
NEWTASK=3D"$(cat /home/sven/Dropbox/myconf/from-mobile.org | grep -v auto-revert | grep = -v ^$ | grep -v 20[0-9][0-9])"

if [ -n "$NEWTASK" ];
then
=A0 =A0if [ -n "$KILLNR" ];
=A0 =A0then
=A0 =A0 =A0 =A0exit
# =A0 =A0 =A0 echo "file is full, conky is running"
=A0 =A0else
=A0 =A0 =A0 =A0conky -c ~/.conkyrc-mobile &
# =A0 =A0 =A0 echo "file is full, conky is not running"
=A0 =A0fi
else
=A0 =A0if [ -n "$KILLNR" ];
=A0 =A0then
=A0 =A0 =A0 =A0kill $KILLNR
# =A0 =A0 =A0 echo "file is empty, conky is running"
=A0 =A0else
=A0 =A0 =A0 =A0exit
# =A0 =A0 =A0 echo "file is empty, conky is not running"
=A0 =A0fi
fi
--8<---------------cut here---------------end--------------->8---

This script needs a special configuration file .conkyrc-mobile to be
placed in the home folder:

--8<---------------cut here---------------start------------->8---
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

use_spacer right

use_xft yes
xftfont DejaVu Sans:size=3D18
xftalpha 0.8
text_buffer_size 2048

update_interval 3.0

draw_shades no

draw_outline no
draw_borders no
uppercase no

stippled_borders 3

border_margin 9

border_width 10

default_color grey

own_window_colour brown
own_window_transparent yes

alignment top_right

gap_x 10
gap_y 10

TEXT
$color

${Color green}NEW TASKS
${execi 10 cat /home/sven/Dropbox/myconf/from-mobile.org | grep -v auto-revert | grep -v ^$ |= grep -v 20[0-9][0-9]}$color
--8<---------------cut here---------------end--------------->8---

--00163646bf8ade20b50496d494ee-- --===============0577809610== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0577809610==--