Fix clock function
This commit is contained in:
parent
154a5faebe
commit
ec3c516deb
39
gtd.el
39
gtd.el
@ -261,6 +261,15 @@ show up there.\n\n"))
|
|||||||
when (string= (plist-get cal :calendar-id) calid)
|
when (string= (plist-get cal :calendar-id) calid)
|
||||||
return (plist-get cal :inbox))))
|
return (plist-get cal :inbox))))
|
||||||
calinbox)))
|
calinbox)))
|
||||||
|
|
||||||
|
;;
|
||||||
|
;;; Reference system
|
||||||
|
|
||||||
|
(load! "roam")
|
||||||
|
|
||||||
|
;;
|
||||||
|
;;; Misc
|
||||||
|
|
||||||
(after! org
|
(after! org
|
||||||
(setq org-clock-persist t
|
(setq org-clock-persist t
|
||||||
;; Useful when clocking in on a waiting task
|
;; Useful when clocking in on a waiting task
|
||||||
@ -284,7 +293,29 @@ show up there.\n\n"))
|
|||||||
org-pomodoro-short-break-length 5
|
org-pomodoro-short-break-length 5
|
||||||
org-pomodoro-long-break-length 20))
|
org-pomodoro-long-break-length 20))
|
||||||
|
|
||||||
;;
|
(defvar org-clock-heading-str-limit 40
|
||||||
;;; Reference system
|
"Maximum length of `org-clock-heading' string. Will be truncated if too long.")
|
||||||
|
(defun max/org-clock-get-clock-string ()
|
||||||
(load! "roam")
|
"Form a clock string that will be shown in a status bar.
|
||||||
|
Adapted from `org-clock-get-clock-string'."
|
||||||
|
(require 'org-clock)
|
||||||
|
(when (org-clocking-p)
|
||||||
|
(let* ((currently-clocked-time
|
||||||
|
(floor (org-time-convert-to-integer
|
||||||
|
(time-since org-clock-start-time))
|
||||||
|
60))
|
||||||
|
(org-clock-heading-str (if (> (length org-clock-heading) org-clock-heading-str-limit)
|
||||||
|
(concat (substring org-clock-heading 0 org-clock-heading-str-limit) "...")
|
||||||
|
org-clock-heading))
|
||||||
|
(clocked-time (org-clock-get-clocked-time))
|
||||||
|
(work-done-str (org-duration-from-minutes clocked-time))
|
||||||
|
(current-work-done-str (org-duration-from-minutes currently-clocked-time)))
|
||||||
|
(if org-clock-effort
|
||||||
|
(let* ((effort-in-minutes (org-duration-to-minutes org-clock-effort))
|
||||||
|
(effort-str (org-duration-from-minutes effort-in-minutes)))
|
||||||
|
(format "%s (%s/%s) %s"
|
||||||
|
org-clock-heading-str work-done-str effort-str current-work-done-str))
|
||||||
|
(format "%s (%s) %s"
|
||||||
|
org-clock-heading-str
|
||||||
|
work-done-str
|
||||||
|
current-work-done-str)))))
|
||||||
|
27
org.el
27
org.el
@ -6,33 +6,6 @@
|
|||||||
|
|
||||||
(require 'org)
|
(require 'org)
|
||||||
|
|
||||||
(defvar org-clock-heading-str-limit 20
|
|
||||||
"Maximum length of `org-clock-heading' string. Will be truncated if too long.")
|
|
||||||
(defun max/org-clock-get-clock-string ()
|
|
||||||
"Form a clock string that will be shown in a status bar.
|
|
||||||
Adapted from `org-clock-get-clock-string'."
|
|
||||||
(require 'org-clock)
|
|
||||||
(when (org-clocking-p)
|
|
||||||
(let* ((currently-clocked-time
|
|
||||||
(floor (org-time-convert-to-integer
|
|
||||||
(time-since org-clock-start-time))
|
|
||||||
60))
|
|
||||||
(org-clock-heading-str (if (> (length org-clock-heading) org-clock-heading-str-limit)
|
|
||||||
(concat (substring org-clock-heading 0 org-clock-string-limit) "...")
|
|
||||||
org-clock-heading))
|
|
||||||
(clocked-time (org-clock-get-clocked-time))
|
|
||||||
(work-done-str (org-duration-from-minutes clocked-time))
|
|
||||||
(current-work-done-str (org-duration-from-minutes currently-clocked-time)))
|
|
||||||
(if org-clock-effort
|
|
||||||
(let* ((effort-in-minutes (org-duration-to-minutes org-clock-effort))
|
|
||||||
(effort-str (org-duration-from-minutes effort-in-minutes)))
|
|
||||||
(format "%s (%s/%s) %s"
|
|
||||||
org-clock-heading-str work-done-str effort-str current-work-done-str))
|
|
||||||
(format "%s (%s) %s"
|
|
||||||
org-clock-heading
|
|
||||||
work-done-str
|
|
||||||
current-work-done-str)))))
|
|
||||||
|
|
||||||
;; Fix org-babel shell block not inheriting envrc
|
;; Fix org-babel shell block not inheriting envrc
|
||||||
;; https://github.com/purcell/envrc/issues/28
|
;; https://github.com/purcell/envrc/issues/28
|
||||||
(advice-add 'org-babel-eval :around #'envrc-propagate-environment)
|
(advice-add 'org-babel-eval :around #'envrc-propagate-environment)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user