summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2024-06-14 17:02:38 -0700
committerChristian Cunningham <cc@localhost>2024-06-14 17:02:38 -0700
commit844dcc6352bdd0e724da7329dc1295f67cb06c12 (patch)
treed098b7e2c75eb7e7783e1d498713590f0f42351d
parentd9487cd10a8dcd265efd56a5e8dad740c4c082df (diff)
Breakout Headings to File
-rw-r--r--.gitignore2
-rw-r--r--elchemy-dashboard.el32
-rw-r--r--elchemy-user.el20
3 files changed, 22 insertions, 32 deletions
diff --git a/.gitignore b/.gitignore
index fa54265..758d3cb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
.DS_Store
-dashboard.org
assets/splash*.png
projects
+headings
diff --git a/elchemy-dashboard.el b/elchemy-dashboard.el
index a8b3482..44a22d0 100644
--- a/elchemy-dashboard.el
+++ b/elchemy-dashboard.el
@@ -12,17 +12,18 @@
(let ((start (point)))
(insert "Elchemy Dashboard")
(add-text-properties start (point)
- '(face (:height 4.0))))
- (insert "\n\n")
- (elchemy/display-tabular-button-alist
- elchemy/dashboard/heading-buttons
- elchemy/dashboard/heading-columns elchemy/dashboard/heading-padding)
- (insert "\n\n")
+ `(face (:height ,elchemy/dashboard/header-size))))
+ (insert "\n")
+ (when (file-exists-p (concat elchemy/elchemy-root elchemy/elchemy-headings-file))
+ (elchemy/display-tabular-button-alist
+ (elchemy/read-alist-file (concat elchemy/elchemy-root elchemy/elchemy-headings-file))
+ elchemy/dashboard/heading-columns elchemy/dashboard/heading-padding)
+ (insert "\n"))
(when (file-exists-p (concat elchemy/elchemy-root elchemy/elchemy-projects-file))
(let ((start (point)))
(insert "Projects")
(add-text-properties start (point)
- '(face (:height 1.5))))
+ `(face (:height ,elchemy/dashboard/subheader-size))))
(insert "\n")
(elchemy/display-tabular-button-alist
(elchemy/read-alist-file (concat elchemy/elchemy-root elchemy/elchemy-projects-file))
@@ -35,15 +36,15 @@
(let ((start (point)))
(insert "Agenda")
(add-text-properties start (point)
- '(face (:height 1.5))))
+ '(face (:height elchemy/dashboard/subheader-size))))
(insert "\n")
- (insert (apply 'format (concat "%-" (format "%d" (+ agenda-max-length elchemy/dashboard-agenda-padding)) "s" "%-" (format "%d" (+ agenda-max-length elchemy/dashboard-agenda-padding)) "s" "%s\n") elchemy/dashboard-agenda-titles))
+ (insert (apply 'format (concat "%-" (format "%d" (+ agenda-max-length elchemy/dashboard/agenda-padding)) "s" "%-" (format "%d" (+ agenda-max-length elchemy/dashboard/agenda-padding)) "s" "%s\n") elchemy/dashboard-agenda-titles))
(dotimes (i agenda-max-count)
(insert (format
- (concat "%-" (format "%d" (+ agenda-max-length elchemy/dashboard-agenda-padding)) "s")
+ (concat "%-" (format "%d" (+ agenda-max-length elchemy/dashboard/agenda-padding)) "s")
(elchemy/replace-nil (nth i (nth 0 agenda-items)))))
(insert (format
- (concat "%-" (format "%d" (+ agenda-max-length elchemy/dashboard-agenda-padding)) "s")
+ (concat "%-" (format "%d" (+ agenda-max-length elchemy/dashboard/agenda-padding)) "s")
(elchemy/replace-nil (nth i (nth 1 agenda-items)))))
(insert (format
"%s"
@@ -54,21 +55,21 @@
(let ((start (point)))
(insert "Overdue")
(add-text-properties start (point)
- '(face (:height 1.5))))
+ `(face (:height ,elchemy/dashboard/subheader-size))))
(insert "\n")
(insert (elchemy/format-processed-agenda (mapcar 'elchemy/process-agenda-heading (org-ql-select (org-agenda-files) `(and (todo "STRT" "WAIT" "TODO" "CYCL") (ts :from ,(- elchemy/schedule-lookahead) :to today)) :sort '(todo priority date)))))
(insert "\n")
(let ((start (point)))
(insert "Upcoming")
(add-text-properties start (point)
- '(face (:height 1.5))))
+ `(face (:height ,elchemy/dashboard/subheader-size))))
(insert "\n")
(insert (elchemy/format-processed-agenda (mapcar 'elchemy/process-agenda-heading (org-ql-select (org-agenda-files) `(and (or (todo "STRT" "WAIT" "TODO") (todo "CYCL")) (ts :from today :to ,elchemy/schedule-lookahead)) :sort '(todo priority date)))))
(insert "\n"))
(let ((start (point)))
(insert "Command Reference")
(add-text-properties start (point)
- '(face (:height 1.5))))
+ `(face (:height ,elchemy/dashboard/subheader-size))))
(insert "\n")
(insert "C-/ ~ Undo\n")
(insert "C-x n n ~ Narrow\n")
@@ -91,7 +92,8 @@
(insert (buttonize "Refresh" '(lambda (x) (elchemy/recreate-dashboard))))
(insert "\n")
(button-mode +1)
- (read-only-mode +1))))
+ (read-only-mode +1)
+ (beginning-of-buffer))))
(defun elchemy/recreate-dashboard ()
"Recreate the dashboard"
diff --git a/elchemy-user.el b/elchemy-user.el
index 2d9d1d2..e3ba380 100644
--- a/elchemy-user.el
+++ b/elchemy-user.el
@@ -4,25 +4,12 @@
;; Dashboard
(setq elchemy/dashboard/heading-columns 4
- elchemy/dashboard/heading-buttons '(("Open Local TODO" . (lambda (x) (elchemy/find-file "~/org/todo.org")))
- ("Open Remote TODO" . (lambda (x) (elchemy/find-file "/ssh:onid:todo.org")))
- ("Open Local Notes" . (lambda (x) (elchemy/find-file "~/org/notes.org")))
- ("Open Remote Notes" . (lambda (x) (elchemy/find-file "/ssh:onid:knowledge.org")))
- ("Open Terminal" . (lambda (x) (elchemy/term "/bin/zsh")))
- ("Open Scratch" . (lambda (x)
- (when (one-window-p)
- (split-window-right))
- (other-window 1)
- (scratch-buffer)))
- ("User Settings" . (lambda (x) (elchemy/find-file (concat elchemy/elchemy-root "elchemy-user.el"))))
- ("Personal Config" . (lambda (x) (elchemy/find-file (concat elchemy/elchemy-root "elchemy-personal.el"))))
- ("Testing File" . (lambda (x) (elchemy/find-file "/ssh:onid:test.el")))
- )
- elchemy/dashboard/heading-max-length (apply #'max (mapcar #'(lambda (x) (length (car x))) elchemy/dashboard/heading-buttons))
elchemy/dashboard/heading-padding 2
elchemy/dashboard/projects-columns 4
elchemy/dashboard/projects-padding 2
- elchemy/dashboard-agenda-padding 2)
+ elchemy/dashboard/agenda-padding 2
+ elchemy/dashboard/header-size 4.0
+ elchemy/dashboard/subheader-size 2.0)
;; General Settings
(setq default-directory "~/"
@@ -40,6 +27,7 @@
elchemy/user/org-todo-file-name "todo.org"
elchemy/user/org-notes-file-name "notes.org"
elchemy/user/org-hideaway t
+ elchemy/elchemy-headings-file "headings"
elchemy/elchemy-projects-file "projects"
elchemy/dashboard-splash "assets/splash.png"
elchemy/dashboard-agenda-titles '(#("TODO" 0 4 (fontify t face (:foreground "red")))