diff options
Diffstat (limited to '.emacs.d/rul-lisp/packages/rul-org.el')
-rw-r--r-- | .emacs.d/rul-lisp/packages/rul-org.el | 67 |
1 files changed, 29 insertions, 38 deletions
diff --git a/.emacs.d/rul-lisp/packages/rul-org.el b/.emacs.d/rul-lisp/packages/rul-org.el index d076948..409517e 100644 --- a/.emacs.d/rul-lisp/packages/rul-org.el +++ b/.emacs.d/rul-lisp/packages/rul-org.el @@ -1,24 +1,36 @@ -;; Debian packages: elpa-org -;; Elpa packages: org-modern +;;; rul-org.el --- Org configuration (require 'org) (require 'org-capture) (require 'org-protocol) (require 'org-habit) -(require 'rul-config-org) - (require 'rul-org-agenda) -(require 'rul-org-journal) +(setq org-attach-use-inheritance t) (setq org-cycle-separator-lines 0) -(setq org-startup-indented t) (setq org-hide-leading-stars nil) +(setq org-startup-indented t) +(setq org-edit-src-content-indentation 0) (use-package org-modern :ensure t) -(use-package org-pomodoro :ensure t) +(use-package org-pomodoro + :ensure t + :config + (defun rul/disable-notifications () + "Disable GNOME notifications." + (shell-command "gsettings set org.gnome.desktop.notifications show-banners false")) -(add-hook 'org-mode-hook 'turn-off-auto-fill) -(add-hook 'auto-save-hook 'org-save-all-org-buffers) + (defun rul/enable-notifications () + "Enable GNOME notifications." + (shell-command "gsettings set org.gnome.desktop.notifications show-banners true")) + + ;; Add hooks for Pomodoro start and finish + (add-hook 'org-pomodoro-started-hook #'rul/disable-notifications) + (add-hook 'org-pomodoro-finished-hook #'rul/enable-notifications) + (add-hook 'org-pomodoro-killed-hook #'rul/enable-notifications)) + +;; (add-hook 'org-mode-hook 'turn-off-auto-fill) +;; (add-hook 'auto-save-hook 'org-save-all-org-buffers) (add-hook 'org-mode-hook 'visual-line-mode) (use-package org-download @@ -39,6 +51,10 @@ (global-set-key (kbd "C-c c") #'org-capture) (global-set-key (kbd "C-c s") #'org-schedule) +(global-set-key (kbd "<f9>") 'bh/punch-in) +(global-set-key (kbd "<f10>") 'bh/punch-out) +(global-set-key (kbd "<f12>") 'org-agenda) + ;; ORG STATES ;; (setq org-todo-keywords (quote ((sequence "TODO(t)" "MAYBE(m)" "NEXT(n)" "|" "DONE(d)") @@ -59,16 +75,16 @@ (setq org-log-done (quote time)) (setq org-log-redeadline (quote time)) (setq org-log-reschedule (quote time)) +(setq org-log-into-drawer t) ;; CAPTURE ;; -(setq org-default-notes-file org-refile-path) (setq org-capture-templates (quote ( ("w" "Todo" entry (file+headline org-refile-path "Tasks") - "* TODO " + "* TODO %?" :empty-lines 1) ("m" @@ -84,39 +100,14 @@ ("L" "Web Link" entry (file+headline org-refile-path "Read later") - "* %?[[%:link][%:description]] %(progn (setq rul/delete-frame-after-capture 1) \"\")\n %:initial\n \nCaptured On: %U" + "* %?[[%:link][%:description]]\n %:initial\n \nCaptured On: %U" ) ("l" "Web Link with Selection" entry (file+headline org-refile-path "Read later") - "* [[%:link][%:description]] %(progn (setq rul/delete-frame-after-capture 1) \"\")\n %:initial\n \nCaptured On: %U") - + "* [[%:link][%:description]]\n %:initial\n \nCaptured On: %U") ))) -(defvar rul/delete-frame-after-capture 0 "Whether to delete the last frame after the current capture") - -(defun rul/delete-frame-if-necessary () - "Delete the last frame if necessary." - (cond - ((= rul/delete-frame-after-capture 0) nil) - ((> rul/delete-frame-after-capture 1) - (setq rul/delete-frame-after-capture (- rul/delete-frame-after-capture 1))) - (t - (setq rul/delete-frame-after-capture 0) - (delete-frame)))) - -(defun rul/org-capture-before () - "Function to run before org capture." - (setq rul/delete-frame-after-capture (1+ rul/delete-frame-after-capture))) - -(defun rul/org-capture-after () - "Function to run after org capture." - (rul/delete-frame-if-necessary)) - -(advice-add 'org-capture-finalize :after 'rul/delete-frame-if-necessary) -(advice-add 'org-capture-kill :after 'rul/delete-frame-if-necessary) -(advice-add 'org-capture-refile :after 'rul/delete-frame-if-necessary) - ;; REFILE ;; ; Targets include this file and any file contributing to the agenda - up to 3 levels deep |