GithubHelp home page GithubHelp logo

ladicle / xbar-plugin-org-clock Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 351 KB

Show the org-clock item on macOS menu bar

License: GNU General Public License v3.0

Shell 100.00%
emacs org-mode xbar-plugin

xbar-plugin-org-clock's Introduction

xbar plugin org-clock

screenshot screenshot-agenda

This xbar plugin shows the current clock-in item on the menu bar. xbar(ex-BitBar) is a macOS tool that shows the custom message on the menu bar.

Installation

xbar

  1. Download org-clock.1m.sh from this repository.
  2. Open xbar plugin folder.
  3. Store the script in the above directory.

Emacs

Create a data directory and then add configuration to init.el.

mkdir -p ~/.xbar/org-clock/
(leaf xbar-org-clock
  :defvar
  (xbar-org-clock-status-file
   xbar-org-clock-agenda-file
   xbar-org-clock-agenda-key
   xbar-org-clock-agenda-sync-interval)
  :custom
  (xbar-org-clock-status-file . "~/.xbar/org-clock/status")
  (xbar-org-clock-agenda-file . "~/.xbar/org-clock/agenda")
  (xbar-org-clock-agenda-key  . "n")
  (xbar-org-clock-agenda-sync-interval . 1800) ;; 30m
  :preface
  (defun xbar-org-clock--write-agenda ()
    (progn
      (org-agenda nil xbar-org-clock-agenda-key)
      (org-agenda-write xbar-org-clock-agenda-file)))
  (defun xbar-org-clock--write-clockin-status ()
    (with-temp-buffer
      (insert (concat
               (format-time-string "%s" org-clock-start-time)
               "\t"
               org-clock-heading))
      (write-region (point-min) (point-max) xbar-org-clock-status-file)))
  (defun xbar-org-clock--delete-clockin-status ()
    (delete-file xbar-org-clock-status-file))
  :hook
  (org-clock-in-hook     . xbar-org-clock--write-clockin-status)
  (org-clock-out-hook    . xbar-org-clock--delete-clockin-status)
  (org-clock-cancel-hook . xbar-org-clock--delete-clockin-status)
  :config
  (run-with-timer 0 xbar-org-clock-agenda-sync-interval 'xbar-org-clock--write-agenda))

References

xbar-plugin-org-clock's People

Contributors

ladicle avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.