commit f4aac5eeb749945a9f824f0f40eb15ae338b6033
parent cb5ffa2a1404e2cf51ca48e43a0712bd59aaef7e
Author: Michael Neuper <michael@michaelneuper.com>
Date: Sun, 31 Aug 2025 23:20:14 +0200
add calendar
Diffstat:
| M | config.org | | | 71 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| M | init.el | | | 2 | +- |
| M | packages.el | | | 23 | +++++++++++++++++++++++ |
3 files changed, 95 insertions(+), 1 deletion(-)
diff --git a/config.org b/config.org
@@ -26,6 +26,7 @@ This is my literate doom emacs config.
- [[#term][:term]]
- [[#tools][:tools]]
- [[#lang][:lang]]
+ - [[#app][app]]
* Basic
** Defaults
@@ -1354,3 +1355,73 @@ Set up =org-roam= and =org-roam-ui= along with their keybindings that have the [
:desc "Open ORUI"
"u" #'org-roam-ui-open))
#+end_src
+** app
+*** calendar
+=calfw= displays holidays by default, let's turn that off.
+#+begin_src emacs-lisp
+(use-package! calfw
+ :config
+ (setq cfw:display-calendar-holidays nil)
+
+ (custom-set-faces!
+ `(cfw:face-toolbar
+ :background ,(doom-color 'bg))))
+
+(use-package! calfw-blocks
+ :after calfw)
+#+end_src
+
+Integrate with the mac calendar.
+There is currently a bug in the code, until my PR is merged,
+the following patch has to be applied:
+https://github.com/haji-ali/maccalfw/pull/4/commits/fcbc3f30b919bc6a21e33d99a407e92758527db3
+#+begin_src emacs-lisp
+(use-package! maccalfw
+ :if (featurep :system 'macos)
+ :after calfw-blocks
+ :commands (maccalfw-open my/maccalfw-open-selective my/maccalfw-open-assessments)
+ :init
+ (defun my/maccalfw-open-selective ()
+ "Open calfw with selected calendars."
+ (interactive)
+ (require 'maccalfw)
+ (maccalfw--load-module)
+ (let* ((all-calendars (maccalfw-get-calendars))
+ (calendar-names (mapcar
+ (lambda (cal)
+ (plist-get cal :title))
+ all-calendars))
+ (selected-names (completing-read-multiple
+ "Select calendars: "
+ calendar-names))
+ (selected-calendars (seq-filter
+ (lambda (cal)
+ (member (plist-get cal :title)
+ selected-names))
+ all-calendars)))
+ (maccalfw-open
+ selected-calendars)))
+
+ (defun my/maccalfw-open-assessments ()
+ "Open calfw with the Assessments calendar in monthly view."
+ (interactive)
+ (require 'maccalfw)
+ (maccalfw--load-module)
+ (let* ((all-calendars (maccalfw-get-calendars))
+ (assessments-calendar (seq-find
+ (lambda (cal)
+ (string=
+ (plist-get cal :title)
+ "Assessments"))
+ all-calendars)))
+ (cfw:open-calendar-buffer
+ :view 'month
+ :contents-sources
+ (list (maccalfw--create-source
+ (plist-get assessments-calendar :title)
+ (plist-get assessments-calendar :id)
+ (doom-color 'red)))
+ :sorter (or (and (fboundp #'calfw-blocks-default-sorter)
+ #'calfw-blocks-default-sorter)
+ #'string-lessp)))))
+#+end_src
diff --git a/init.el b/init.el
@@ -169,7 +169,7 @@
;;(wanderlust +gmail)
:app
- ;;calendar
+ calendar
;;emms
;;everywhere ; *leave* Emacs!? You must be joking
;;irc ; how neckbeards socialize
diff --git a/packages.el b/packages.el
@@ -51,3 +51,26 @@
(package! casual)
(package! colorful-mode)
(package! rainbow-delimiters)
+;; OTHER
+;; CALENDAR
+(package! calfw :recipe
+ (:host github
+ :repo "kiwanami/emacs-calfw"
+ :fork (:repo "haji-ali/emacs-calfw"
+ :fork (:repo "michaelneuper/emacs-calfw"
+ ;; FIXME fix branch not begin checked out
+ :branch "fix"))))
+
+(package! calfw-blocks :recipe
+ (:host github
+ :repo "haji-ali/calfw-blocks"
+ :fork (:repo "michaelneuper/calfw-blocks"
+ :branch "fix-dispatch-and-colors")))
+
+(package! maccalfw :recipe
+ (:host github
+ :repo "haji-ali/maccalfw"
+ :files ("maccalfw.el"
+ "ical-form.el"
+ ("src" . "src")))
+ :ignore (not (featurep :system 'macos)))