Org-mode rework

This commit is contained in:
Tristan D. 2025-04-25 12:11:27 +02:00
parent 2d92dcf0c1
commit ae0e5b846b
Signed by: tristan
SSH key fingerprint: SHA256:9oFM1J63hYWJjCnLG6C0fxBS15rwNcWwdQNMOHYKJ/4
3 changed files with 287 additions and 8 deletions

View file

@ -59,6 +59,102 @@
;; Encrypt all roam notes;;;;;;;;;;;;;;;;; ;; Encrypt all roam notes;;;;;;;;;;;;;;;;;
(use-package! websocket
:after org-roam)
;; TODO Set org agenda clockreport settings
;; (setq!
;; org-agenda-clockreport-parameter-plist '(:block thisweek :tcolumns 3 :maxlevel 4 :stepskip0 t :fileskip0 t :step day :filetitle t
;; :properties ("Effort" "CLOCKSUM")
;; ))
(after! org
(defun zp/org-protocol-insert-selection-dwim (selection)
"Insert SELECTION as an org blockquote."
(message "MOEP")
(unless (string= selection "")
;;(format "#+begin_quote\n%s\n#+end_quote" selection)
(format "\n%s\n" selection)))
(setq org-log-into-drawer t
org-log-done 'time
org-log-repeat 'time
org-log-redeadline 'note
org-log-reschedule 'note
org-agenda-files (list "~/org/roam/" "~/org/roam/daily/")
org-agenda-file-regexp "\\`[^.].*\\.org\\'"
org-roam-capture-ref-templates
'(
("r" "ref" plain "* %U\n%(zp/org-protocol-insert-selection-dwim \"%i\")%?"
:target (file+head "web/${slug}.org" "#+title: ${title}\n#+roam_key: ${ref}\n#+created: %u\n")
:unnarrowed t))
org-capture-templates
'(
("g" "Work: General To-Do"
entry (file+olp "~/org/roam/todos.org" "Work" "General Tasks")
"* TODO [#B] %?\n:Created: %T\n "
:empty-lines 0)
("c" "Work: Code To-Do"
entry (file+olp "~/org/roam/todos.org" "Work" "Code Tasks")
"* TODO [#B] %?\n:Created: %T\n%i\n%a\nProposed Solution: "
:empty-lines 0)
("b" "Work: Bug/Issue To-Do"
entry (file+olp "~/org/roam/todos.org" "Work" "Bugs")
"* TODO [#B] %?\n:Created: %T\n%i\n%a\nProposed Solution: "
:empty-lines 0)
("l" "Work: Log"
entry (file+olp+datetree "~/org/roam/worklog.org" "Log")
"* [ ] :log: %<%H:%M> %?\n:Created: %T\n"
:clock-in t
:clock-resume t
:empty-lines 0)
("m" "Work: Meeting"
entry (file+olp+datetree "~/org/roam/meetings.org" "Work")
"* %? :meeting:%^g \n:Created: %T\n** Attendees\n*** \n** Notes\n** Action Items\n*** TODO [#A] "
:tree-type week
:clock-in t
:clock-resume t
:empty-lines 0)
("p" "Priv: General To-Do"
entry (file+olp "~/org/roam/todos.org" "Private" "General Tasks")
"* TODO [#B] %?\n:Created: %T\n "
:empty-lines 0)
("w" "Web site" entry
(file "~/org/roam/web.org")
"* %a :website:\n\n%U %?\n\n%:initial")
)
org-todo-keywords
'((sequence
"TODO(t)"
"PLANNING(p)"
"IN-PROGRESS(i@/!)"
"ONHOLD(h!)"
"VERIFYING(v!)"
"BLOCKED(b@)"
"|"
"DONE(d!)"
"OBE(o@!)"
"WONT-DO(w@/!)")
(sequence
"[ ](T)" ; A task that needs doing
"[-](S)" ; Task is in progress
"[?](W)" ; Task is being held up or paused
"|"
"[X](D)")) ; Task was completed
org-todo-keyword-faces
'(("[-]" . +org-todo-active)
("[?]" . +org-todo-onhold)
;; ("[?]" . +org-todo-onhold)
("TODO" . (:foreground "GoldenRod" :weight bold))
("PLANNING" . (:foreground "DeepPink" :weight bold))
("IN-PROGRESS" . (:foreground "Cyan" :weight bold))
("ONHOLD" . (:foreground "Tan" :weight bold))
("VERIFYING" . (:foreground "DarkOrange" :weight bold))
("BLOCKED" . (:foreground "Red" :weight bold))
("DONE" . (:foreground "LimeGreen" :weight bold))
("OBE" . (:foreground "LimeGreen" :weight bold))
("WONT-DO" . (:foreground "LimeGreen" :weight bold))))
)
(after! org-roam (after! org-roam
;; Org Roam ui is better ;; Org Roam ui is better
@ -70,14 +166,171 @@
;; (file+head "%<%Y%m%d%H%M%S>-${slug}.org.gpg" ;; (file+head "%<%Y%m%d%H%M%S>-${slug}.org.gpg"
;; "#+title: ${title}\n") ;; "#+title: ${title}\n")
;; :unnarrowed t))) ;; :unnarrowed t)))
;; (setq org-roam-dailies-capture-templates '(("d" "default" entry "* %?"
;; :target
;; (file+head "%<%Y-%m-%d>.org.gpg"
;; "#+title: %<%Y-%m-%d>\n")
;; :unnarrowed t)))
;;
) )
;; Tags
;; (setq org-tag-alist '(
;; ;; Ticket types
;; (:startgroup . nil)
;; ("@bug" . ?b)
;; ("@feature" . ?u)
;; ("@spike" . ?j)
;; (:endgroup . nil)
;; ;; Ticket flags
;; ("@write_future_ticket" . ?w)
;; ("@emergency" . ?e)
;; ("@research" . ?r)
;; ;; Meeting types
;; (:startgroup . nil)
;; ("big_sprint_review" . ?i)
;; ("cents_sprint_retro" . ?n)
;; ("dsu" . ?d)
;; ("grooming" . ?g)
;; ("sprint_retro" . ?s)
;; (:endgroup . nil)
;; ;; Code TODOs tags
;; ("QA" . ?q)
;; ("backend" . ?k)
;; ("broken_code" . ?c)
;; ("frontend" . ?f)
;; ;; Special tags
;; ("CRITICAL" . ?x)
;; ("obstacle" . ?o)
;; ;; Meeting tags
;; ("HR" . ?h)
;; ("general" . ?l)
;; ("meeting" . ?m)
;; ("misc" . ?z)
;; ("planning" . ?p)
;; ;; Work Log Tags
;; ("accomplishment" . ?a)
;; ))
;; Tag colors
;; (setq org-tag-faces
;; '(
;; ("planning" . (:foreground "mediumPurple1" :weight bold))
;; ("backend" . (:foreground "royalblue1" :weight bold))
;; ("frontend" . (:foreground "forest green" :weight bold))
;; ("QA" . (:foreground "sienna" :weight bold))
;; ("meeting" . (:foreground "yellow1" :weight bold))
;; ("CRITICAL" . (:foreground "red1" :weight bold))
;; )
;; )
(use-package! org-super-agenda
:custom
(org-agenda-custom-commands
'(
;; James's Super View
("j" "James's Super View"
(
(agenda ""
(
(org-agenda-remove-tags t)
(org-agenda-span 7)
)
)
(alltodo ""
(
;; Remove tags to make the view cleaner
(org-agenda-remove-tags t)
(org-agenda-prefix-format " %t %s")
(org-agenda-overriding-header "CURRENT STATUS")
;; Define the super agenda groups (sorts by order)
(org-super-agenda-groups
'(
;; Today
(:name "Today" ; Optionally specify section name
:time-grid t ; Items that appear on the time grid
:todo "TODAY") ; Items that have this TODO keyword
;; Filter where tag is CRITICAL
(:name "Critical Tasks"
:tag "CRITICAL"
:order 0
)
;; Filter where TODO state is IN-PROGRESS
(:name "Currently Working"
:todo "IN-PROGRESS"
:order 10
)
;; Filter where TODO state is PLANNING
(:name "Planning Next Steps"
:todo "PLANNING"
:order 20
)
;; Filter where TODO state is BLOCKED or where the tag is obstacle
(:name "Problems & Blockers"
:todo "BLOCKED"
:tag "obstacle"
:order 30
)
;; Filter where tag is @write_future_ticket
(:name "Tickets to Create"
:tag "@write_future_ticket"
:order 40
)
;; Hold
(:name "Consider Continuing"
:todo "ONHOLD"
:order 35
)
;; Filter where tag is @research
(:name "Research Required"
:tag "@research"
:order 70
)
;; Filter where tag is meeting and priority is A (only want TODOs from meetings)
(:name "Meeting Action Items"
:and (:tag "meeting" :priority "A")
:order 80
)
;; Filter where state is TODO and the priority is A and deadline near/schedule past
(:name "Important Long-Term Items"
:and (:todo "TODO" :priority "A" :not (:tag "meeting"))
:order 85
)
;; Filter where state is TODO and the priority is A and the tag is not meeting
(:name "Important Long-Term Items"
:and (:todo "TODO" :priority "A" :not (:tag "meeting"))
:order 90
)
;; Filter where state is TODO and priority is B
(:name "General Backlog"
:and (:todo "TODO" :priority "B")
:order 95
)
;; Filter where the priority is C or less (supports future lower priorities)
(:name "Non Critical"
:priority<= "C"
:order 110
)
;; Filter where TODO state is VERIFYING
(:name "Currently Being Verified"
:todo "VERIFYING"
:order 200
)
)
)
)
)
))
))
)
(use-package! org-roam-ui
:after org-roam ;; or :after org
;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have
;; a hookable mode anymore, you're advised to pick something yourself
;; if you don't care about startup time, use
;; :hook (after-init . org-roam-ui-mode)
:config
(setq org-roam-ui-sync-theme t
org-roam-ui-follow t
org-roam-ui-update-on-save t
org-roam-ui-open-on-start t))
(after! evil-goggles (after! evil-goggles

View file

@ -38,6 +38,16 @@
;;(package! builtin-package :recipe (:branch "develop")) ;;(package! builtin-package :recipe (:branch "develop"))
;; Use `:pin' to specify a particular commit to install. ;; Use `:pin' to specify a particular commit to install.
;;
(package! org-protocol-capture-html)
(package! org-super-agenda)
(unpin! org-roam)
(package! org-roam-ui)
(package! websocket)
;; systemd unit files
(package! systemd)
;; tabs ;; tabs
(package! centaur-tabs) (package! centaur-tabs)

View file

@ -295,6 +295,21 @@ in
# }; # };
}; };
# fix emacs org protocol
xdg.mimeApps.defaultApplications."x-scheme-handler/org-protocol" = [
(lib.mkBefore "org-protocol.desktop")
];
xdg.desktopEntries."org-protocol" = {
name = "org-protocol";
comment = "fixes org-roam-capture & co";
exec = "emacsclient %u";
type = "Application";
noDisplay = true;
terminal = false;
categories = [ "System" ];
mimeType = [ "x-scheme-handler/org-protocol" ];
};
services = { services = {
ssh-agent.enable = true; ssh-agent.enable = true;
gpg-agent = { gpg-agent = {
@ -398,6 +413,7 @@ in
nh nh
pkgs.agenix-rekey pkgs.agenix-rekey
my.aaxtomp3 my.aaxtomp3
graphviz # for org-roam
# android-studio-full # android-studio-full
]; ];
}; };