[Org] Provide function to set frame title from current clock
This commit is contained in:
parent
541851ed00
commit
44e6818abb
2
init.el
2
init.el
@ -643,6 +643,7 @@ search commands like `db/helm-shortcuts’."
|
|||||||
db/find-parent-task
|
db/find-parent-task
|
||||||
db/ensure-running-clock
|
db/ensure-running-clock
|
||||||
db/save-current-org-task-to-file
|
db/save-current-org-task-to-file
|
||||||
|
db/org-update-frame-title-with-current-clock
|
||||||
db/org-clock-out
|
db/org-clock-out
|
||||||
db/org-clock-in-break-task
|
db/org-clock-in-break-task
|
||||||
db/org-clock-in-home-task
|
db/org-clock-in-home-task
|
||||||
@ -885,6 +886,7 @@ search commands like `db/helm-shortcuts’."
|
|||||||
(org-clock-persistence-insinuate)
|
(org-clock-persistence-insinuate)
|
||||||
|
|
||||||
(add-hook 'org-clock-in-hook #'db/org-mark-current-default-task)
|
(add-hook 'org-clock-in-hook #'db/org-mark-current-default-task)
|
||||||
|
(add-hook 'org-clock-in-hook #'db/org-update-frame-title-with-current-clock)
|
||||||
|
|
||||||
;; Clock in default task if no other task is given
|
;; Clock in default task if no other task is given
|
||||||
(add-hook 'org-clock-out-hook #'db/ensure-running-clock 'append)
|
(add-hook 'org-clock-out-hook #'db/ensure-running-clock 'append)
|
||||||
|
|||||||
@ -262,7 +262,7 @@ In ~%s~:
|
|||||||
(org-reset-checkbox-state-subtree)))
|
(org-reset-checkbox-state-subtree)))
|
||||||
|
|
||||||
|
|
||||||
;; Helper Functions for Clocking
|
;;; Helper Functions for Clocking
|
||||||
|
|
||||||
(defun db/find-parent-task ()
|
(defun db/find-parent-task ()
|
||||||
;; http://doc.norang.ca/org-mode.html#Clocking
|
;; http://doc.norang.ca/org-mode.html#Clocking
|
||||||
@ -308,6 +308,14 @@ In ~%s~:
|
|||||||
(insert "No running clock")
|
(insert "No running clock")
|
||||||
(insert org-clock-heading)))))
|
(insert org-clock-heading)))))
|
||||||
|
|
||||||
|
(defun db/org-update-frame-title-with-current-clock ()
|
||||||
|
"Set the frametitle of the current frame to the headline of the
|
||||||
|
current task."
|
||||||
|
(interactive)
|
||||||
|
(let ((clock-buffer (marker-buffer org-clock-marker)))
|
||||||
|
(when clock-buffer
|
||||||
|
(modify-frame-parameters nil `((name . , org-clock-heading))))))
|
||||||
|
|
||||||
|
|
||||||
;;; Fixes
|
;;; Fixes
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user