Add some icons to ‘org-agenda-category-icon-alist’
BIN
oni-org/icons/icons8-bug-64.png
Normal file
After Width: | Height: | Size: 2 KiB |
BIN
oni-org/icons/icons8-checkmark-64.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
oni-org/icons/icons8-code-64.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
oni-org/icons/icons8-email-64.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
oni-org/icons/icons8-game-controller-64.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
oni-org/icons/icons8-inbox-64.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
oni-org/icons/icons8-light-64.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
oni-org/icons/icons8-shopping-cart-64.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
oni-org/icons/icons8-sprout-64.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
oni-org/icons/icons8-workstation-64.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
;; Author: Tom Willemse <tom@ryuslash.org>
|
;; Author: Tom Willemse <tom@ryuslash.org>
|
||||||
;; Keywords: local
|
;; Keywords: local
|
||||||
;; Version: 2020.0812.204753
|
;; Version: 2020.0818.080005
|
||||||
;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org-plus-contrib org-bullets org-edna diminish all-the-icons)
|
;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org-plus-contrib org-bullets org-edna diminish all-the-icons)
|
||||||
|
|
||||||
;; This program is free software; you can redistribute it and/or modify
|
;; This program is free software; you can redistribute it and/or modify
|
||||||
|
@ -22,7 +22,9 @@
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
|
||||||
;; Configuration for `org-mode'.
|
;; Configuration for `org-mode'. The icons used in
|
||||||
|
;; ‘org-agenda-category-icon-alist’ are from the Gradient Line style of Icons 8.
|
||||||
|
;; See URL ‘htps://icons8.com’.
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
@ -50,6 +52,10 @@
|
||||||
(expand-file-name "snippets" oni-org-root)
|
(expand-file-name "snippets" oni-org-root)
|
||||||
"The directory where ‘oni-org’ stores its snippets.")
|
"The directory where ‘oni-org’ stores its snippets.")
|
||||||
|
|
||||||
|
(defconst oni-org-icons-dir
|
||||||
|
(expand-file-name "icons" oni-org-root)
|
||||||
|
"The directory where ‘oni-org’ stores its icons.")
|
||||||
|
|
||||||
(defun oni-org-expand-to-home (file-name)
|
(defun oni-org-expand-to-home (file-name)
|
||||||
"Expand FILE-NAME to the base directory for that system.
|
"Expand FILE-NAME to the base directory for that system.
|
||||||
The base for all org files on Windows is u:/, but on my linux
|
The base for all org files on Windows is u:/, but on my linux
|
||||||
|
@ -167,6 +173,27 @@ After running it once remove it from `org-capture-after-finalize-hook'."
|
||||||
(setq org-tag-faces (oni-org-generate-tag-faces))
|
(setq org-tag-faces (oni-org-generate-tag-faces))
|
||||||
(org-set-tag-faces 'org-tag-faces org-tag-faces))
|
(org-set-tag-faces 'org-tag-faces org-tag-faces))
|
||||||
|
|
||||||
|
(defun oni-org-set-agenda-category-icons ()
|
||||||
|
"Set ‘org-agenda-category-icon-alist’."
|
||||||
|
(let* ((icon-height (window-default-font-height))
|
||||||
|
(defaults `(png nil :height ,icon-height :ascent center)))
|
||||||
|
(setq org-agenda-category-icon-alist
|
||||||
|
`((,(rx string-start "task" string-end) ,(expand-file-name "icons8-checkmark-64.png" oni-org-icons-dir) ,@defaults)
|
||||||
|
(,(rx string-start "inbox" string-end) ,(expand-file-name "icons8-inbox-64.png" oni-org-icons-dir) ,@defaults)
|
||||||
|
(,(rx string-start "email" string-end) ,(expand-file-name "icons8-email-64.png" oni-org-icons-dir) ,@defaults)
|
||||||
|
(,(rx string-start "life" string-end) ,(expand-file-name "icons8-sprout-64.png" oni-org-icons-dir) ,@defaults)
|
||||||
|
(,(rx string-start "feature" string-end) ,(expand-file-name "icons8-code-64.png" oni-org-icons-dir) ,@defaults)
|
||||||
|
(,(rx string-start "work" string-end) ,(expand-file-name "icons8-workstation-64.png" oni-org-icons-dir) ,@defaults)
|
||||||
|
(,(rx string-start "game" string-end) ,(expand-file-name "icons8-game-controller-64.png" oni-org-icons-dir) ,@defaults)
|
||||||
|
(,(rx string-start "shopping" string-end) ,(expand-file-name "icons8-shopping-cart-64.png" oni-org-icons-dir) ,@defaults)
|
||||||
|
(,(rx string-start "bug" string-end) ,(expand-file-name "icons8-bug-64.png" oni-org-icons-dir) ,@defaults)
|
||||||
|
(,(rx string-start "idea" string-end) ,(expand-file-name "icons8-light-64.png" oni-org-icons-dir) ,@defaults)))))
|
||||||
|
|
||||||
|
(defun oni-org-initialize-agenda-category-icons ()
|
||||||
|
"Set ‘org-agenda-category-icon-alist’ if it hasn’t already been set."
|
||||||
|
(when (null org-agenda-category-icon-alist)
|
||||||
|
(oni-org-set-agenda-category-icons)))
|
||||||
|
|
||||||
;;;###autoload(autoload 'oni-hydra-org/body "oni-org")
|
;;;###autoload(autoload 'oni-hydra-org/body "oni-org")
|
||||||
(defhydra oni-hydra-org (:color teal :hint nil)
|
(defhydra oni-hydra-org (:color teal :hint nil)
|
||||||
"
|
"
|
||||||
|
@ -331,6 +358,7 @@ also move point to the start of the heading."
|
||||||
|
|
||||||
(add-to-list 'org-babel-load-languages '(java . t))
|
(add-to-list 'org-babel-load-languages '(java . t))
|
||||||
|
|
||||||
|
(add-hook 'org-mode-hook #'oni-org-initialize-agenda-category-icons)
|
||||||
(add-hook 'org-mode-hook #'oni-org-set-tag-faces)
|
(add-hook 'org-mode-hook #'oni-org-set-tag-faces)
|
||||||
(add-hook 'org-mode-hook #'oni-org-set-todo-keyword-faces)
|
(add-hook 'org-mode-hook #'oni-org-set-todo-keyword-faces)
|
||||||
(add-hook 'org-mode-hook 'flyspell-mode)
|
(add-hook 'org-mode-hook 'flyspell-mode)
|
||||||
|
|