From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id mMCDHgcEYl/pFQAA0tVLHw (envelope-from ) for ; Wed, 16 Sep 2020 12:24:39 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id uDmAGgcEYl90LQAA1q6Kng (envelope-from ) for ; Wed, 16 Sep 2020 12:24:39 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id EC0789403C6 for ; Wed, 16 Sep 2020 12:24:38 +0000 (UTC) Received: from localhost ([::1]:40408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIWUH-00058M-MS for larch@yhetil.org; Wed, 16 Sep 2020 08:24:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIWLW-0000K8-8h for emacs-orgmode@gnu.org; Wed, 16 Sep 2020 08:15:38 -0400 Received: from dal1relay103.mxroute.com ([199.181.239.103]:40753) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kIWLO-0003YL-D2 for emacs-orgmode@gnu.org; Wed, 16 Sep 2020 08:15:33 -0400 Received: from filter003.mxroute.com ([168.235.111.26] 168-235-111-26.cloud.ramnode.com) (Authenticated sender: mN4UYu2MZsgR) by dal1relay103.mxroute.com (ZoneMTA) with ESMTPSA id 17496d734e30004d87.001 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Wed, 16 Sep 2020 12:15:20 +0000 X-Zone-Loop: a0d17e4e3fdfed681750046d1e55cbd985b5a09c3f60 X-Originating-IP: [168.235.111.26] Received: from friday.mxlogin.com (friday.mxlogin.com [159.69.65.104]) by filter003.mxroute.com (Postfix) with ESMTPS id 4ECB160062 for ; Wed, 16 Sep 2020 12:15:19 +0000 (UTC) Subject: Re: official orgmode parser To: emacs-orgmode@gnu.org References: <68dc1ea1-52e8-7d9e-fb2d-bcf08c111eca@intrepidus.pl> <87d02n2yyr.fsf@gmail.com> <482cea5c-4214-57ac-dfeb-1e305180fee5@intrepidus.pl> <875z8echfi.fsf@mbork.pl> <87h7rym9xi.fsf@localhost> <87een2lyja.fsf@localhost> From: =?UTF-8?B?UHJ6ZW15c8WCYXcgS2FtacWEc2tp?= Message-ID: <1e35b658-11c2-0b25-0f7b-ecd37ed06a5d@intrepidus.pl> Date: Wed, 16 Sep 2020 14:15:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <87een2lyja.fsf@localhost> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-AuthUser: pk@mmksoft.uk Received-SPF: pass client-ip=199.181.239.103; envelope-from=pk@intrepidus.pl; helo=dal1relay103.mxroute.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/16 08:15:24 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.062, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: 9mNMwIs20WKE On 9/16/20 2:02 PM, Ihor Radchenko wrote: >> However what Ihor presented is interesting. Do you use similar approach >> with shellout and 'emacs -batch' to show currently running task or you >> 'push' data from emacs to show it in the taskbar? > > I prefer to avoid querying emacs too often for performance reasons. > Instead, I only update the clocking info when I clock in/out in emacs. > Then, the clocked in time is dynamically updated by independent bash > script. > > The scheme is the following: > 1. org clock in/out in Emacs trigger writing clocking info into > ~/.org-clock-in status file > 2. bash script periodically monitors the file and calculates the clocked > in time according to the contents and time from last modification > 3. the script updates simple textbox widget using awesome-client > 4. the script also warns me (notify-send) when the weighted clocked in > time is negative (meaning that I should switch to some more > productive activity) > > Best, > Ihor > > Przemysław Kamiński writes: > >> On 9/16/20 9:56 AM, Ihor Radchenko wrote: >>>> Wow, another awesomewm user here; could you share your code? >>> >>> Are you interested in something particular about awesome WM integration? >>> >>> I am using simple textbox widgets to show currently clocked in task and >>> weighted summary of clocked time. See the attachments. >>> >>> Best, >>> Ihor >>> >>> >>> >>> >>> Marcin Borkowski writes: >>> >>>> On 2020-09-15, at 11:17, Przemysław Kamiński wrote: >>>> >>>>> So, I keep clock times for work in org mode, this is very >>>>> handy. However, my customers require that I use their service to >>>>> provide the times. They do offer API. So basically I'm using elisp to >>>>> parse org, make API calls, and at the same time generate CSV reports >>>>> with a Python interop with org babel (because my elisp is just too bad >>>>> to do that). If I had access to some org parser, I'd pick a language >>>>> that would be more comfortable for me to get the job done. I guess it >>>>> can all be done in elisp, however this is just a tool for me alone and >>>>> I have limited time resources on hacking things for myself :) >>>> >>>> I was in the exact same situation - I use Org-mode clocking, and we use >>>> Toggl at our company, so I wrote a simple tool to fire API requests to >>>> Toggl on clock start/cancel/end: https://github.com/mbork/org-toggl >>>> It's a bit more than 200 lines of Elisp, so you might try to look into >>>> it and adapt it to whatever tool your employer is using. >>>> >>>>> Another one is generating total hours report for day/week/month to put >>>>> into my awesomewm toolbar. I ended up using orgstat >>>>> https://github.com/volhovM/orgstat >>>>> however the author is creating his own DSL in YAML and I guess things >>>>> were much better off if it all stayed in some Scheme :) >>>> >>>> Wow, another awesomewm user here; could you share your code? >>>> >>>> Best, >>>> >>>> -- >>>> Marcin Borkowski >>>> http://mbork.pl >> >> >> I don't have interesting code, just standard awesomevm setup. I run >> periodic script to output data computed by orgstat and show it in the >> taskbar (uses the shellout_widget). >> >> However what Ihor presented is interesting. Do you use similar approach >> with shellout and 'emacs -batch' to show currently running task or you >> 'push' data from emacs to show it in the taskbar? >> >> P. So basically this is what this thread is about. One needs a working Emacs instance and work in "push" mode to export any Org data. This requires dealing with temporary files, as described above, and some ad-hoc formats to keep whatever data I need to pull from org. "Pull" mode would be preferred. I could then, say, write a script in Guile, execute 'emacs -batch' to export org data (I'm ok with that), then parse the S-expressions to get what I need. P.