[[https://github.com/matryer/bitbar][Bitbar]] is a macos application that can add custom menu bar buttons.
I'm recently learning managing projects with org-mode. And we all know that org-agenda is great.
So I write a bitbar plugin, [[https://github.com/yqrashawn/bitbar-plugin-agenda][agenda]] to display some of my agenda in menu bar.
*** feature
Like this.
[[file:bitbar-ext-org-agenda.png]]
*** usage User need to specify the command to export the agenda-view to txt file.
I'm using emacs [[https://www.emacswiki.org/emacs/BatchMode][--batch]] feature to generate the txt file silently. There may better way for doing this, like ~org-batch-agenda~ ([[http://orgmode.org/manual/Extracting-agenda-information.html][check out here]]). But when my emacs configuration piles up, there's lots of initializing message which makes it hard to extract the agenda-view data. So I just use the ~org-agenda-write~ command to write agenda-view to disk.
emacs --batch -l ~/.emacs.d/init.el --eval "(run-hooks 'emacs-startup-hook)" \ --eval '(progn (org-agenda nil "r") (org-agenda-write "~/agendas/work/todos.txt") (spacemacs/kill-emacs))'
Note: for [[https://github.com/syl20bnr/spacemacs][spacemacs]] user, you need to add ~(run-hooks 'emacs-startup-hook)~ to let emacs read your ~dotspacemacs/user-config~ ([[https://github.com/syl20bnr/spacemacs/issues/4504][issue#4504]]).
For using this plugin. You need to specify ~agenda_directory~ ~agenda_file_name~.
agenda_directory = "#{Dir.home}/agendas/work/" agenda_name = 'todos.txt'
And also the agenda custom command key, you may in your configuration file, you can find your setting using ~(describe-variable 'org-agenda-custom-commands)~.
agenda_custome_command = 'B'
The problem of using ~--batch~ is to [[https://emacs.stackexchange.com/questions/5451/how-do-i-force-kill-emacs/5456][really kill emacs]].
kill_emacs_function = '(let (kill-emacs-hook) (kill-emacs))'
You can also change colors of filter line and lines with priority.
tag_color = 'orange'
labels = { '[#A]' => 'red', '[#B]' => 'yellow', '[#C]' => 'violet' }
If you use pacakges that will change filters' format in agenda view, you need to specify ~tag_indicator~ .
tag_indicator = 'Headlines with TAGS match: '
*** limitation
Current version don't support ~agenda-view~ when you add, say you add the below code in the chosen ~org-agenda-custom-commands~.
(agenda ((org-agenda-ndays 7)))