Skip to content

Instantly share code, notes, and snippets.

@roman
Created January 8, 2015 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roman/42f4b2916c3760235cb5 to your computer and use it in GitHub Desktop.
Save roman/42f4b2916c3760235cb5 to your computer and use it in GitHub Desktop.
Clocker's packages.el
(defvar clocker-packages
'(powerline
dash))
(defface clocker/mode-line-clock-in-face
'((t (:foreground "white" :background "#F2686C" :inherit mode-line)))
"Clocker's face for CLOCK-IN mode-line message."
:group 'clocker)
(defun clocker/org-clocking-p ()
(and (fboundp 'org-clocking-p)
(org-clocking-p)))
(defun clocker/add-clock-in-to-mode-line (lhs)
(let ((new-lhs
(if (not (clocker/org-clocking-p))
(-insert-at 1 (powerline-raw "CLOCK-IN "
'clocker/mode-line-clock-in-face
'l)
lhs)
lhs)))
(setq ad-return-value new-lhs)))
(defun clocker/init-clocker ()
(message "CALLING INIT CLOCKER!")
(use-package org
:config
(progn
(defadvice spacemacs/mode-line-prepare-left (around compile activate)
(clocker/add-clock-in-to-mode-line ad-do-it)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment