emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: org-mode time tracking setup integrating with SaaS (Harvest, Toggl,


From: Dr. Arne Babenhauserheide
Subject: Re: org-mode time tracking setup integrating with SaaS (Harvest, Toggl, Bonsai etc)
Date: Sat, 10 Oct 2020 11:21:07 +0200
User-agent: mu4e 1.4.13; emacs 27.1

Daryl Manning <dwm+orgmode@wakatara.com> writes:

> Has anyone run across a good integration for doing that or has a blog post
> on their system particularly where they need to track hours/tasks across a
> few clients and projects for consultancy purposes

I don’t do consultancy, but we I need to book for multiple projects at
work. I track my time and projects with org-mode (and found that
whenever I think “this is so small, I don’t need an org-headline for
this”, time gets out of hand). At the end of the week I then book my
time on the corresponding Jira issues using the clocktable in
agenda-view.

These are my essential customizations for that:

(use-package org-agenda
  :defer 8
  :custom
  (alert-default-style 'libnotify)
  (appt-disp-window-function 'alert-for-appt)
  (appt-delete-window-function (lambda ()))
  (org-agenda-clock-consistency-checks
   (quote
    (:max-duration "12:00" :min-duration 0 :max-gap "0:05" :gap-ok-around
                   ("4:00" "12:00")
                   :default-face
                   ((:background "DarkRed")
                    (:foreground "white"))
                   :overlap-face nil :gap-face nil :no-end-time-face nil 
:long-face nil :short-face nil)))
  (org-agenda-clockreport-parameter-plist (quote (:link t :maxlevel 2 
:properties ("Effort"))))
  (org-agenda-start-with-clockreport-mode t)
  :config
  ;; Rebuild the reminders everytime the agenda is displayed
  (add-hook 'org-agenda-finalize-hook (lambda () (org-agenda-to-appt t)))
  ;; Run once when Emacs starts
  (org-agenda-to-appt t)
  ;; Activate appointments so we get notifications
  (appt-activate t))

(defun my/org-agenda-show-kanban ()
  (interactive)
  (save-excursion
    (search-forward ":KANBAN:")
    (org-agenda-goto)
    (org-narrow-to-subtree)
    (show-all)
    (fit-window-to-buffer)
    (widen)
    (recenter-top-bottom 0)))

;; KDE: show custom agenda with kanban via f12:
(with-eval-after-load 'org
  (setq org-agenda-custom-commands
        '(("o" "Agenda and TODOs"
           ((agenda)
            (tags-todo "-notodo" ((org-agenda-block-separator ?-)))
            (tags "KANBAN" ((org-agenda-block-separator 
?-)(org-agenda-compact-blocks nil)(org-agenda-overriding-header "")))))))

;; from https://www.emacswiki.org/emacs/TransposeWindows solution by Robert Bost
(defun rotate-windows (arg)
  "Rotate your windows; use the prefix argument to rotate the other direction"
  (interactive "P")
  (if (not (> (count-windows) 1))
      (message "You can't rotate a single window!")
    (let* ((rotate-times (prefix-numeric-value arg))
           (direction (if (or (< rotate-times 0) (equal arg '(4)))
                          'reverse 'identity)))
      (dotimes (_ (abs rotate-times))
        (dotimes (i (- (count-windows) 1))
          (let* ((w1 (elt (funcall direction (window-list)) i))
                 (w2 (elt (funcall direction (window-list)) (+ i 1)))
                 (b1 (window-buffer w1))
                 (b2 (window-buffer w2))
                 (s1 (window-start w1))
                 (s2 (window-start w2))
                 (p1 (window-point w1))
                 (p2 (window-point w2)))
            (set-window-buffer-start-and-point w1 b2 s2 p2)
            (set-window-buffer-start-and-point w2 b1 s1 p1)))))))


(defun agenda-and-todo ()
  (interactive)
  (org-agenda nil "o")
  (delete-other-windows)
  (my/org-agenda-show-kanban)
  (rotate-windows 1))
;;      systemsettings shortcuts: map f12 to
;;        emacsclient -e '(progn (show-frame)(agenda-and-todo))'
(global-set-key (kbd "<f12>") 'agenda-and-todo)

;; KDE: record new issue with M-f12 (alt f12):
;;      systemsettings shortcuts: map alt f12 to
;;        emacsclient -e '(progn (show-frame)(org-capture))'
(global-set-key (kbd "M-<f12>") 'org-capture)

;; clock into the current task via S-f12 (shift f12). rationale: shift
;; is used to shift from one task to another without clocking out.
(global-set-key (kbd "S-<f12>") 'org-clock-in)

;; KDE: global clock out via M-S-f12 (alt-shift f12):
;;      systemsettings shortcuts: map f12 to
;;        emacsclient -e '(progn (show-frame)(org-clock-out))'
(global-set-key (kbd "M-S-<f12>") 'org-clock-out)

(defun show-frame (&optional frame)
  "Show the current Emacs frame or the FRAME given as argument.

And make sure that it really shows up!"
  (raise-frame)
  ; yes, you have to call this twice. Don’t ask me why…
  ; select-frame-set-input-focus calls x-focus-frame and does a bit of
  ; additional magic.
  (select-frame-set-input-focus (selected-frame))
  (select-frame-set-input-focus (selected-frame)))


I have a dedicated emacs environment for work that I brought over into
homeoffice.

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]