Skip to content

Commit

Permalink
feat: add me-calendar WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Jun 17, 2023
1 parent 91bf7f2 commit 665f39f
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/me-modules.el
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
;; me-rss ; News feed (elfeed, ...)
;; me-lifestyle ; *Very* opinionated lifestyle packages (awqat, ...)
me-docs ; Documents (pdf-tools, nov, ...)
;; me-calendar ; Calendar (calfw, calfw-org, calfw-ical, ...)
me-latex ; LaTeX (auctex, auctex-latexmk, reftex, bibtex, ...)
;; me-biblio ; Bibliography & citations (org-cite, citar, zotxt, ...)
me-natural-langs ; Natural language stuff (spell-fu, go-translate, eglot-ltex, ...)
Expand Down
73 changes: 73 additions & 0 deletions modules/me-calendar.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
;;; me-calendar.el --- Calendar integration -*- lexical-binding: t; -*-

;; Copyright (C) 2022-2023 Abdelhak Bougouffa

;; Author: Abdelhak Bougouffa (concat "abougouffa" "@" "fedora" "project" "." "org")

;;; Commentary:

;; This is a WIP

;;; Code:

(use-package calfw
:straight t
:custom
(cfw:face-item-separator-color nil)
(cfw:render-line-breaker #'cfw:render-line-breaker-none)
(cfw:fchar-junction ?╋)
(cfw:fchar-vertical-line ?┃)
(cfw:fchar-horizontal-line ?━)
(cfw:fchar-left-junction ?┣)
(cfw:fchar-right-junction ?┫)
(cfw:fchar-top-junction ?┯)
(cfw:fchar-top-left-corner ?┏)
(cfw:fchar-top-right-corner ?┓)
:commands cfw:open-calendar-buffer
:init
(+map! "oc" (+def-dedicated-tab! cfw:open-calendar-buffer))
:config
(advice-add
'cfw:render-button :override
(defun +cfw:render-button-flat-a (title command &optional state)
"render-button
TITLE
COMMAND
STATE"
(let ((text (concat " " title " "))
(keymap (make-sparse-keymap)))
(cfw:rt text (if state 'cfw:face-toolbar-button-on
'cfw:face-toolbar-button-off))
(define-key keymap [mouse-1] command)
(cfw:tp text 'keymap keymap)
(cfw:tp text 'mouse-face 'highlight)
text))))

(use-package calfw-ical
:straight t
:demand t
:after calfw)

(use-package calfw-cal
:straight t
:demand t
:after calfw)

(use-package calfw-org
:straight t
:demand t
:after calfw
:commands +cfw-open-calendar
:config
(defun +cfw-open-calendar ()
"Open the calendar."
(interactive)
(cfw:open-calendar-buffer
;; :custom-map cfw:my-cal-map
:contents-sources
(list (cfw:org-create-source (face-foreground 'default))))))


(provide 'me-calendar)

;;; me-calendar.el ends here
1 change: 1 addition & 0 deletions skel/modules.el
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
;; me-rss ; News feed (elfeed, ...)
;; me-lifestyle ; *Very* opinionated lifestyle packages (awqat, ...)
me-docs ; Documents (pdf-tools, nov, ...)
;; me-calendar ; Calendar (calfw, calfw-org, calfw-ical, ...)
me-latex ; LaTeX (auctex, auctex-latexmk, reftex, bibtex, ...)
;; me-biblio ; Bibliography & citations (org-cite, citar, zotxt, ...)
me-natural-langs ; Natural language stuff (spell-fu, go-translate, eglot-ltex, ...)
Expand Down

0 comments on commit 665f39f

Please sign in to comment.