|
|
|
|
@ -779,67 +779,95 @@ |
|
|
|
|
#+end_src |
|
|
|
|
- Use figlet-type fonts to display the date |
|
|
|
|
#+begin_src emacs-lisp |
|
|
|
|
(setq figlet |
|
|
|
|
[["███" "██ " "███" "███" "█ █" "███" "███" "███" "███" "███"] |
|
|
|
|
["█ █" " █ " " █" " █" "█ █" "█ " "█ " " █" "█ █" "█ █"] |
|
|
|
|
["█ █" " █ " "███" "███" "███" "███" "███" " █" "███" "███"] |
|
|
|
|
["█ █" " █ " "█ " " █" " █" " █" "█ █" " █" "█ █" " █"] |
|
|
|
|
["███" "███" "███" "███" " █" "███" "███" " █" "███" "███"]]) |
|
|
|
|
|
|
|
|
|
(setq figlet-lean |
|
|
|
|
[["┌──┐" "╶┐ " "╶──┐" "╶──┐" "╷ ╷" "┌──╴" "┌──╴" "╶──┐" "┌──┐" "┌──┐"] |
|
|
|
|
["│ │" " │ " " │" " │" "│ │" "│ " "│ " " │" "│ │" "│ │"] |
|
|
|
|
["│ │" " │ " "┌──┘" "╶──┤" "└──┤" "└──┐" "├──┐" " │" "├──┤" "└──┤"] |
|
|
|
|
["│ │" " │ " "│ " " │" " │" " │" "│ │" " │" "│ │" " │"] |
|
|
|
|
["└──┘" "╶┴╴" "└──╴" "╶──┘" " ╵" "╶──┘" "└──┘" " ╵" "└──┘" "╶──┘"]]) |
|
|
|
|
|
|
|
|
|
(defun figlet-digit (digit row) |
|
|
|
|
(aref (aref figlet-lean row) digit)) |
|
|
|
|
|
|
|
|
|
(defun figlet-num (number row) |
|
|
|
|
(let ((n number) |
|
|
|
|
(d (list))) |
|
|
|
|
(while (> n 0) |
|
|
|
|
(setq d (append (list (mod n 10)) d)) |
|
|
|
|
(setq n (/ n 10))) |
|
|
|
|
(string-join (mapcar |
|
|
|
|
(lambda (digit) (concat (figlet-digit digit row) " ")) |
|
|
|
|
d)))) |
|
|
|
|
(defun org-agenda-format-date-figlet (date) |
|
|
|
|
"Format a DATE string for display in the daily/weekly agenda. |
|
|
|
|
This function makes sure that dates are aligned for easy reading." |
|
|
|
|
;(require 'cal-iso) |
|
|
|
|
(let* ((dayname (calendar-day-name date)) |
|
|
|
|
(day (cadr date)) |
|
|
|
|
(day-of-week (calendar-day-of-week date)) |
|
|
|
|
(month (car date)) |
|
|
|
|
(monthname (calendar-month-name month)) |
|
|
|
|
(year (nth 2 date))nf |
|
|
|
|
(iso-week (org-days-to-iso-week |
|
|
|
|
(calendar-absolute-from-gregorian date))) |
|
|
|
|
(weekyear (cond ((and (= month 1) (>= iso-week 52)) |
|
|
|
|
(1- year)) |
|
|
|
|
((and (= month 12) (<= iso-week 1)) |
|
|
|
|
(1+ year)) |
|
|
|
|
(t year))) |
|
|
|
|
(weekstring (if (= day-of-week 1) |
|
|
|
|
(format " W%02d" iso-week) |
|
|
|
|
""))) |
|
|
|
|
|
|
|
|
|
(format (concat "\n" |
|
|
|
|
"%-13s %s %4d%s\n" |
|
|
|
|
"%-13s\n" |
|
|
|
|
"%-13s %-10s\n" |
|
|
|
|
"%-13s\n" |
|
|
|
|
"%-13s %s\n") |
|
|
|
|
(figlet-num day 0) monthname year weekstring |
|
|
|
|
(figlet-num day 1) |
|
|
|
|
(figlet-num day 2) dayname |
|
|
|
|
(figlet-num day 3) |
|
|
|
|
(figlet-num day 4) (sunrise-sunset)))) |
|
|
|
|
(setq figlet |
|
|
|
|
[["███" "██ " "███" "███" "█ █" "███" "███" "███" "███" "███"] |
|
|
|
|
["█ █" " █ " " █" " █" "█ █" "█ " "█ " " █" "█ █" "█ █"] |
|
|
|
|
["█ █" " █ " "███" "███" "███" "███" "███" " █" "███" "███"] |
|
|
|
|
["█ █" " █ " "█ " " █" " █" " █" "█ █" " █" "█ █" " █"] |
|
|
|
|
["███" "███" "███" "███" " █" "███" "███" " █" "███" "███"]]) |
|
|
|
|
|
|
|
|
|
(setq figlet-lean |
|
|
|
|
[["┌──┐" "╶┐ " "╶──┐" "╶──┐" "╷ ╷" "┌──╴" "┌──╴" "╶──┐" "┌──┐" "┌──┐"] |
|
|
|
|
["│ │" " │ " " │" " │" "│ │" "│ " "│ " " │" "│ │" "│ │"] |
|
|
|
|
["│ │" " │ " "┌──┘" "╶──┤" "└──┤" "└──┐" "├──┐" " │" "├──┤" "└──┤"] |
|
|
|
|
["│ │" " │ " "│ " " │" " │" " │" "│ │" " │" "│ │" " │"] |
|
|
|
|
["└──┘" "╶┴╴" "└──╴" "╶──┘" " ╵" "╶──┘" "└──┘" " ╵" "└──┘" "╶──┘"]]) |
|
|
|
|
|
|
|
|
|
(defun figlet-digit (digit row) |
|
|
|
|
(aref (aref figlet-lean row) digit)) |
|
|
|
|
|
|
|
|
|
(defun figlet-num (number row) |
|
|
|
|
(let ((n number) |
|
|
|
|
(d (list))) |
|
|
|
|
(while (> n 0) |
|
|
|
|
(setq d (append (list (mod n 10)) d)) |
|
|
|
|
(setq n (/ n 10))) |
|
|
|
|
(string-join (mapcar |
|
|
|
|
(lambda (digit) (concat (figlet-digit digit row) " ")) |
|
|
|
|
d)))) |
|
|
|
|
(defun org-agenda-format-date-figlet (date) |
|
|
|
|
"Format a DATE string for display in the daily/weekly agenda. |
|
|
|
|
This function makes sure that dates are aligned for easy reading." |
|
|
|
|
;(require 'cal-iso) |
|
|
|
|
(let* ((dayname (calendar-day-name date)) |
|
|
|
|
(day (cadr date)) |
|
|
|
|
(day-of-week (calendar-day-of-week date)) |
|
|
|
|
(month (car date)) |
|
|
|
|
(monthname (calendar-month-name month)) |
|
|
|
|
(year (nth 2 date))nf |
|
|
|
|
(iso-week (org-days-to-iso-week |
|
|
|
|
(calendar-absolute-from-gregorian date))) |
|
|
|
|
(weekyear (cond ((and (= month 1) (>= iso-week 52)) |
|
|
|
|
(1- year)) |
|
|
|
|
((and (= month 12) (<= iso-week 1)) |
|
|
|
|
(1+ year)) |
|
|
|
|
(t year))) |
|
|
|
|
(weekstring (if (= day-of-week 1) |
|
|
|
|
(format " W%02d" iso-week) |
|
|
|
|
""))) |
|
|
|
|
|
|
|
|
|
(format (concat "\n" |
|
|
|
|
"%12s %s %4d%s\n" |
|
|
|
|
"%12s \n" |
|
|
|
|
"%12s %-10s\n" |
|
|
|
|
"%12s \n" |
|
|
|
|
"%12s %s\n") |
|
|
|
|
(figlet-num day 0) monthname year weekstring |
|
|
|
|
(figlet-num day 1) |
|
|
|
|
(figlet-num day 2) dayname |
|
|
|
|
(figlet-num day 3) |
|
|
|
|
(figlet-num day 4) (sunrise-sunset)))) |
|
|
|
|
|
|
|
|
|
(setq org-agenda-format-date #'org-agenda-format-date-figlet) |
|
|
|
|
(setq org-agenda-prefix-format |
|
|
|
|
'((agenda . " %i %9c · %?-12t% s") |
|
|
|
|
(todo . " %i %9c · ") |
|
|
|
|
(tags . " %i %9c · ") |
|
|
|
|
(search . " %i %9c · "))) |
|
|
|
|
#+end_src |
|
|
|
|
- Add a whiteline after the header Now, this is a horrible hack: |
|
|
|
|
the string that forms the header is obtained by constructing |
|
|
|
|
some pretty-text in a temporary buffer and then retrieving the |
|
|
|
|
string with #'buffer-string Hence we add (and remove) an advice |
|
|
|
|
to the function buffer-string that concat's a newline around |
|
|
|
|
each function that produces the headers |
|
|
|
|
#+begin_src emacs-lisp |
|
|
|
|
(defun concat-newline (s) |
|
|
|
|
(concat s "\n")) |
|
|
|
|
|
|
|
|
|
(mapcar (lambda (fun) |
|
|
|
|
(advice-add fun :around |
|
|
|
|
(lambda (orig-fun &rest args) |
|
|
|
|
(advice-add #'buffer-string :filter-return #'concat-newline) |
|
|
|
|
(apply orig-fun args) |
|
|
|
|
(advice-remove #'buffer-string #'concat-newline)))) |
|
|
|
|
'(org-tags-view org-todo-list)) |
|
|
|
|
#+end_src |
|
|
|
|
#+begin_src emacs-lisp |
|
|
|
|
(advice-add #'org-agenda--insert-overriding-header :filter-args |
|
|
|
|
(lambda (params) |
|
|
|
|
(list `(concat ,(car params) "\n")))) |
|
|
|
|
#+end_src |
|
|
|
|
|
|
|
|
|
Improve the org-habit graph thing |
|
|
|
|
#+begin_src emacs-lisp |
|
|
|
|
(setq org-habit-regular-glyph ?□ |
|
|
|
|
|