diff options
author | jdlugosz963 <jdlugosz963@gmail.com> | 2025-08-11 17:36:57 +0200 |
---|---|---|
committer | jdlugosz963 <jdlugosz963@gmail.com> | 2025-08-11 17:40:12 +0200 |
commit | bc591dcedf45b80f70661f33c42c68dbd581e901 (patch) | |
tree | 4a3cbd7831d8e0d8ce12f318d64e06848c9ea3ab /files/.emacs.d/jd/jd-org.el | |
parent | 1ebb0e267b40d86386b66b7b81686461446e39f8 (diff) | |
download | dotfiles-bc591dcedf45b80f70661f33c42c68dbd581e901.tar.gz dotfiles-bc591dcedf45b80f70661f33c42c68dbd581e901.zip |
Diffstat (limited to 'files/.emacs.d/jd/jd-org.el')
-rwxr-xr-x | files/.emacs.d/jd/jd-org.el | 222 |
1 files changed, 0 insertions, 222 deletions
diff --git a/files/.emacs.d/jd/jd-org.el b/files/.emacs.d/jd/jd-org.el deleted file mode 100755 index 554533d..0000000 --- a/files/.emacs.d/jd/jd-org.el +++ /dev/null | |||
@@ -1,222 +0,0 @@ | |||
1 | ;;; Dotfiles --- Jakub Dlugosz emacs config | ||
2 | ;;; Commentary: | ||
3 | |||
4 | ;;; Code: | ||
5 | |||
6 | (defvar jd/org-home "~/Notes") | ||
7 | (defvar jd/org-roam-home (concat jd/org-home "/roam")) | ||
8 | (defvar jd/org-sync (concat jd/org-home "/sync")) | ||
9 | (defvar jd/org-roam-daily-home (concat jd/org-roam-home "/daily")) | ||
10 | |||
11 | (defun jd/org-mode-init () | ||
12 | (org-indent-mode) | ||
13 | (variable-pitch-mode 1) | ||
14 | (visual-line-mode 1)) | ||
15 | |||
16 | (defun jd-emacs/org-insert-date (&optional date) | ||
17 | (org-insert-time-stamp (org-read-date nil t (or date "+0d")))) | ||
18 | |||
19 | (use-package org-pomodoro | ||
20 | :guix-package "emacs-org-pomodoro") | ||
21 | |||
22 | (use-package org-caldav | ||
23 | :guix-package "emacs-org-caldav" | ||
24 | :config | ||
25 | (setq org-caldav-url "http://caldav.jdlugosz.com/radicale/admin/" | ||
26 | org-caldav-files nil | ||
27 | org-icalendar-timezone "Europe/Warsaw") | ||
28 | |||
29 | (defun jd/caldav-calendar-sync () | ||
30 | (interactive) | ||
31 | (let ((org-caldav-calendar-id "0c54a523-c7aa-2f26-2c18-a12b69c2bc86") | ||
32 | (org-caldav-inbox (concat jd/org-sync | ||
33 | "/calendar.org"))) | ||
34 | (org-caldav-sync))) | ||
35 | |||
36 | (defun jd/caldav-journal-sync () | ||
37 | (interactive) | ||
38 | (let ((org-caldav-calendar-id "3cc70419-a787-5f84-28c6-96f15fc606d9") | ||
39 | (org-caldav-inbox (concat jd/org-sync | ||
40 | "/journal.org"))) | ||
41 | (org-caldav-sync))) | ||
42 | |||
43 | (defun jd/caldav-tasks-sync () | ||
44 | (interactive) | ||
45 | (let ((org-caldav-calendar-id "372cbbb3-14f7-fc15-9f7b-cae04114920c") | ||
46 | (org-caldav-inbox (concat jd/org-sync | ||
47 | "/tasks.org"))) | ||
48 | (org-caldav-sync)))) | ||
49 | |||
50 | (use-package org | ||
51 | :guix-package "emacs-org" | ||
52 | :pin org | ||
53 | :commands (org-capture org-agenda) | ||
54 | :hook (org-mode . jd/org-mode-init) | ||
55 | :bind | ||
56 | ("C-c o c" . #'org-capture) | ||
57 | ("C-c o p" . #'org-mobile-pull) | ||
58 | ("C-c o P" . #'org-mobile-push) | ||
59 | ("C-c o a" . #'org-agenda) | ||
60 | :config | ||
61 | (defun jd/org-mode-file (file-name) (concat org-directory "/" file-name ".org")) | ||
62 | (setq org-directory (file-truename "~/Notes") | ||
63 | org-mobile-directory (concat org-directory "/Mobile") | ||
64 | org-mobile-inbox-for-pull (concat org-directory "/flagged.org") ;; TODO: ?? | ||
65 | |||
66 | org-refile-targets '((org-agenda-files :maxlevel . 1)) | ||
67 | org-outline-path-complete-in-steps nil | ||
68 | org-refile-use-outline-path t | ||
69 | org-agenda-files '("Personal.org" "Work.org" "Inbox.org" "Collage.org") | ||
70 | org-ellipsis " ▾" | ||
71 | org-agenda-start-with-log-mode t | ||
72 | org-log-done 'time | ||
73 | org-log-into-drawer t | ||
74 | org-return-follows-link t | ||
75 | org-latex-listings 'minted | ||
76 | org-latex-packages-alist '(("" "minted")) | ||
77 | |||
78 | org-agenda-custom-commands | ||
79 | `(("p" "Planning" | ||
80 | ((tags-todo "+planning" | ||
81 | ((org-agenda-overriding-header "Planning Tasks"))) | ||
82 | (tags-todo "-{.*}" | ||
83 | ((org-agenda-overriding-header "Untagged Tasks"))) | ||
84 | (todo "*" ((org-agenda-files '(,(jd/org-mode-file "Inbox"))) | ||
85 | (org-agenda-overriding-header "Unprocessed Inbox Items"))))) | ||
86 | |||
87 | ("d" "Daily Agenda" | ||
88 | ((agenda "" ((org-agenda-span 'day) | ||
89 | (org-deadline-warning-days 7))) | ||
90 | (tags-todo "+PRIORITY=\"A\"" | ||
91 | ((org-agenda-overriding-header "High Priority Tasks"))))) | ||
92 | |||
93 | ("c" "Collage Agenda" | ||
94 | ((agenda "" ((org-agenda-span 'week) | ||
95 | (org-deadline-warning-days 7)))) | ||
96 | ((org-agenda-filter-preset '("+collage")))) | ||
97 | |||
98 | ("w" "Weekly Review" | ||
99 | ((agenda "" | ||
100 | ((org-agenda-overriding-header "Completed Tasks") | ||
101 | (org-agenda-skip-function '(org-agenda-skip-entry-if 'nottodo 'done)) | ||
102 | (org-agenda-span 'week))) | ||
103 | |||
104 | (agenda "" | ||
105 | ((org-agenda-overriding-header "Unfinished Scheduled Tasks") | ||
106 | (org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) | ||
107 | (org-agenda-span 'week)))))) | ||
108 | |||
109 | org-capture-templates | ||
110 | `(("i" "Capture to Inbox" entry (file+olp ,(jd/org-mode-file "Inbox") "Inbox") | ||
111 | "* TODO %?\n %t\n" :empty-lines 1) | ||
112 | ("c" "Capture to Collage" entry (file+olp ,(jd/org-mode-file "Collage") "Collage") | ||
113 | "* TODO %? :collage:%^g \n %t\n" :empty-lines 1)) | ||
114 | |||
115 | org-latex-pdf-process | ||
116 | '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" | ||
117 | "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")) | ||
118 | |||
119 | (require 'org-tempo) | ||
120 | |||
121 | (defun jd/org-font-setup () | ||
122 | (dolist (face '((org-level-1 . 1.3) | ||
123 | (org-level-2 . 1.2) | ||
124 | (org-level-3 . 1.1) | ||
125 | (org-level-4 . 1.0) | ||
126 | (org-level-5 . 1.0) | ||
127 | (org-level-6 . 1.0) | ||
128 | (org-level-7 . 1.0) | ||
129 | (org-level-8 . 1.0))) | ||
130 | (set-face-attribute (car face) nil :font "Terminus" :weight 'Bold :height (cdr face))) | ||
131 | |||
132 | ;; Ensure that anything that should be fixed-pitch in Org files appears that way | ||
133 | (set-face-attribute 'org-block nil :font "Terminus" :inherit 'fixed-pitch :height 100) | ||
134 | (set-face-attribute 'org-table nil :inherit 'fixed-pitch) | ||
135 | (set-face-attribute 'org-formula nil :inherit 'fixed-pitch) | ||
136 | (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch)) | ||
137 | (set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch)) | ||
138 | (set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch)) | ||
139 | (set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch)) | ||
140 | (set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch) | ||
141 | (set-face-attribute 'line-number nil :inherit 'fixed-pitch) | ||
142 | (set-face-attribute 'line-number-current-line nil :inherit 'fixed-pitch)) | ||
143 | |||
144 | (with-eval-after-load 'org (jd/org-font-setup)) | ||
145 | |||
146 | (defun jd-emacs/org-timer-stop () | ||
147 | (start-process-shell-command "notify-send" nil "notify-send Zakonczono odliczanie")) | ||
148 | |||
149 | (add-hook 'org-timer-stop-hook #'jd-emacs/org-timer-stop) | ||
150 | |||
151 | (defun jd/org-tempo-setup () | ||
152 | (dolist (template '(("s" . "src") | ||
153 | ("sql" . "src sql") | ||
154 | ("sh" . "src sh") | ||
155 | ("el" . "src emacs-lisp") | ||
156 | ("li" . "src lisp") | ||
157 | ("sc" . "src scheme") | ||
158 | ("ts" . "src typescript") | ||
159 | ("py" . "src python") | ||
160 | ("go" . "src go") | ||
161 | ("yaml" . "src yaml"))) | ||
162 | (add-to-list 'org-structure-template-alist template))) | ||
163 | |||
164 | (with-eval-after-load 'org-tempo (jd/org-tempo-setup)) | ||
165 | |||
166 | (org-babel-do-load-languages | ||
167 | 'org-babel-load-languages | ||
168 | '((emacs-lisp . t) | ||
169 | (python . t) | ||
170 | (shell . t)))) | ||
171 | |||
172 | (use-package org-superstar | ||
173 | :guix-package "emacs-org-superstar" | ||
174 | :hook (org-mode . org-superstar-mode) | ||
175 | :init | ||
176 | (setq org-superstar-special-todo-items t) | ||
177 | (setq org-superstar-remove-leading-stars t) | ||
178 | (setq org-superstar-headline-bullets-list '("◉" "○" "●" "○" "●" "○" "●"))) | ||
179 | |||
180 | (use-package org-roam | ||
181 | :guix-package "emacs-org-roam" | ||
182 | :custom | ||
183 | (org-roam-directory (file-truename jd/org-roam-home)) | ||
184 | :bind (("C-c n l" . org-roam-buffer-toggle) | ||
185 | ("C-c n f" . org-roam-node-find) | ||
186 | ("C-c n g" . org-roam-graph) | ||
187 | ("C-c n i" . org-roam-node-insert) | ||
188 | ("C-c n c" . org-roam-capture) | ||
189 | ;; Dailies | ||
190 | ("C-c n j" . org-roam-dailies-capture-today)) | ||
191 | :bind-keymap | ||
192 | ("C-c n d" . org-roam-dailies-map) | ||
193 | :config | ||
194 | (require 'org-roam-dailies) | ||
195 | |||
196 | (defun jd/org-roam-filter-by-tag (tag-name) | ||
197 | (lambda (node) | ||
198 | (member tag-name (org-roam-node-tags node)))) | ||
199 | |||
200 | (defun jd/org-roam-list-notes-by-tag (tag-name) | ||
201 | (mapcar #'org-roam-node-file | ||
202 | (seq-filter | ||
203 | (jd/org-roam-filter-by-tag tag-name) | ||
204 | (org-roam-node-list)))) | ||
205 | |||
206 | (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag))) | ||
207 | (setq org-roam-capture-templates | ||
208 | '(("d" "default" plain "%?" | ||
209 | :target (file+head+olp | ||
210 | "%<%Y%m%d%H%M%S>-${slug}.org" | ||
211 | "#+title: ${title}\n\n" | ||
212 | ("${title}")) | ||
213 | :unnarrowed t))) | ||
214 | |||
215 | (org-roam-db-autosync-mode)) | ||
216 | |||
217 | (use-package ox-pandoc | ||
218 | :guix-package "emacs-ox-pandoc") | ||
219 | |||
220 | (provide 'jd-org) | ||
221 | |||
222 | ;;; jd-org.el ends here | ||