emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: Nathan Neff <nathan.neff@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Show current task in taskbar
Date: Wed, 20 Apr 2011 21:34:55 +0100	[thread overview]
Message-ID: <8762q8slu8.fsf@ucl.ac.uk> (raw)
In-Reply-To: <BANLkTi=udUi9RvOzApp5MNKuN4OP7+xgJw@mail.gmail.com> (Nathan Neff's message of "Mon, 18 Apr 2011 10:03:53 -0500")

Nathan Neff <nathan.neff@gmail.com> writes:

> Hello,
>
> I use wmii which is a minimalist tiling window manager.
> It has a taskbar that can show text/icons, etc.
>
> I'd like to see my currently logged in task on the taskbar.
>
> The way I see it, I could either 1) poll emacs for the current task
> or 2) have emacs run a cron job and output the current task to a file
> or directly
> set the taskbar
>
> Has anyone done something like this?  I found the "External Programs" section
> on this page:  http://orgmode.org/worg/org-hacks.html but didn't find
> anything directly.
>
> Thanks,
> --Nate

With ratpoison, I use either conky or dzen2 to write out a status line
that is outside the window manager's control.  one of the things I used
to do is echo the contents of a file to that status bar and that file
would include the clocking information.  this clocking information was
generated by the following elisp code:

--8<---------------cut here---------------start------------->8---
(defun esf/org-clocking-info-to-file ()
  (with-temp-file "~/tmp/clocking"
    ;; (message (org-clock-get-clock-string))
    (if (org-clock-is-active)
	(insert (format "org: %d/%d min" 
			(- (org-clock-get-clocked-time) org-clock-total-time)
			(org-clock-get-clocked-time))
		)
      ) ;;(org-clock-get-clock-string)
    )
  )
(add-hook 'display-time-hook 'esf/org-clocking-info-to-file)
--8<---------------cut here---------------end--------------->8---

I haven't used this in a while so cannot guarantee it will work with org
7.5, say, but it should.  It requires you to have invoked (display-time)
to hook into that display and obviously something to echo the contents
of the file (~/tmp/clocking in above) into your wmii status bar.

HTH,
eric
-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.183.g1997)

      parent reply	other threads:[~2011-04-22 22:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-18 15:03 Show current task in taskbar Nathan Neff
2011-04-18 16:19 ` Matt Lundin
2011-05-09 23:46   ` Nathan Neff
2011-04-20 20:34 ` Eric S Fraga [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8762q8slu8.fsf@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=nathan.neff@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).