Skip to content
Display a Pomodoro timer on an OLED display via org-clock.
C C++ Objective-C Haskell Nix Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
arduino Add content to the README and build files Jul 29, 2019
.gitignore Update default.nix with some helpful commands Jul 29, 2019 Add some pictures of the OLED and status bar Jul 30, 2019
default.nix Add a top-level default.nix for building the Haskell part Aug 5, 2019

Serial Controlled OLED Display

Two programs in one!

  1. Arduino code to read commands from a serial port and update an OLED display.

  2. A Haskell program to display various bits of information on that OLED display via the serial port. This is the controller program that listens for D-Bus signals and updates the display accordingly.

NOTE: Since the controller program uses D-Bus for interprocess communication it's likely to only work on Linux. Patches are welcome.

What Does It Look Like?


Building Everything

This repository contains files for the Nix package manager and it's the way I recommend you build the two packages.

Once you have Nix installed the rest is easy:

  1. Build and flash a Arduino Pro Micro:

      $ cd arduino && nix-shell --run upload
  2. Build and start the controller program:

      $ cd control && nix-build
      $ ./result/bin/display-control

Pomodoros and Org Clock

The following Emacs Lisp will send D-Bus signals when you clock in or out. The Haskell program in this package will respond to those signals by updating the OLED display to show a Pomodoro timer.

(defun pjones:org-clock-update-dbus ()
  "Broadcast a D-Bus signal with the latest `org-clock' data.

This exposes the current clock's start time and heading to any process
listening to the correct D-Bus signal.

You can monitor this signal via the following command:

    dbus-monitor type='signal',interface='org.gnu.Emacs.Org.Clock'

Read the code below for the two event names and the signal arguments
they provide."
  (if (org-clocking-p)
      (let ((start-time (floor (float-time org-clock-start-time)))
            (description org-clock-heading))
         :session nil dbus-path-emacs
         (concat dbus-interface-emacs ".Org.Clock") "Started"
         start-time description))
     :session nil dbus-path-emacs
     (concat dbus-interface-emacs ".Org.Clock") "Stopped")))

(let ((hooks '( org-clock-in-hook
                org-clock-cancel-hook )))
  (dolist (hook hooks)
    (add-hook hook #'pjones:org-clock-update-dbus)))

Current Org Clock Heading

Want to display the OrgMode heading for the currently clocked-in task somewhere? Perhaps a status bar?

curl --silent --unix-socket ~/.display-control.sock 'http://localhost/message' | jq --raw-output

Status Bar

You can’t perform that action at this time.