2018-02-18 03:10:09 -05:00
|
|
|
;;; app/calendar/config.el -*- lexical-binding: t; -*-
|
2018-01-13 17:26:40 +08:00
|
|
|
|
2018-02-19 20:19:54 -05:00
|
|
|
(defvar +calendar-open-function #'+calendar/open-calendar
|
2018-02-19 15:18:36 -05:00
|
|
|
"TODO")
|
|
|
|
|
|
|
|
|
|
|
|
;;
|
2018-09-07 19:36:16 -04:00
|
|
|
;; Packages
|
2018-02-19 15:18:36 -05:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! calfw
|
2019-07-23 12:30:47 +02:00
|
|
|
:commands cfw:open-calendar-buffer
|
2018-01-13 17:26:40 +08:00
|
|
|
:config
|
|
|
|
;; better frame for calendar
|
2018-02-19 15:18:36 -05:00
|
|
|
(setq 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 ?┓)
|
|
|
|
|
2021-03-06 00:05:51 -05:00
|
|
|
(set-popup-rule! "^\\*cfw:details" :quit t :ttl 0 :select t :size 0.4)
|
|
|
|
|
2018-06-03 15:46:00 +02:00
|
|
|
(define-key cfw:calendar-mode-map "q" #'+calendar/quit)
|
2021-03-06 00:06:14 -05:00
|
|
|
(when (featurep! :editor evil +everywhere)
|
|
|
|
(set-evil-initial-state! '(cfw:calendar-mode cfw:details-mode) 'motion)
|
|
|
|
(add-hook! (cfw:calendar-mode cfw:details-mode) #'evil-normalize-keymaps)
|
|
|
|
(map! (:map cfw:calendar-mode-map
|
|
|
|
:m "q" #'+calendar/quit
|
|
|
|
:m "SPC" #'cfw:show-details-command
|
|
|
|
:m "RET" #'cfw:show-details-command
|
|
|
|
:m "TAB" #'cfw:navi-prev-item-command
|
|
|
|
:m [tab] #'cfw:navi-prev-item-command
|
|
|
|
:m [backtab] #'cfw:navi-next-item-command
|
|
|
|
:m "$" #'cfw:navi-goto-week-end-command
|
|
|
|
:m "." #'cfw:navi-goto-today-command
|
|
|
|
:m "<" #'cfw:navi-previous-month-command
|
|
|
|
:m ">" #'cfw:navi-next-month-command
|
|
|
|
:m "C-h" #'cfw:navi-previous-month-command
|
|
|
|
:m "C-l" #'cfw:navi-next-month-command
|
|
|
|
:m "D" #'cfw:change-view-day
|
|
|
|
:m "M" #'cfw:change-view-month
|
|
|
|
:m "T" #'cfw:change-view-two-weeks
|
|
|
|
:m "W" #'cfw:change-view-week
|
|
|
|
:m "^" #'cfw:navi-goto-week-begin-command
|
|
|
|
:m "gr" #'cfw:refresh-calendar-buffer
|
|
|
|
:m "h" #'cfw:navi-previous-day-command
|
|
|
|
:m "H" #'cfw:navi-goto-first-date-command
|
|
|
|
:m "j" #'cfw:navi-next-week-command
|
|
|
|
:m "k" #'cfw:navi-previous-week-command
|
|
|
|
:m "l" #'cfw:navi-next-day-command
|
|
|
|
:m "L" #'cfw:navi-goto-last-date-command
|
|
|
|
:m "t" #'cfw:navi-goto-today-command)
|
|
|
|
(:map cfw:details-mode-map
|
|
|
|
:m "SPC" #'cfw:details-kill-buffer-command
|
|
|
|
:m "RET" #'cfw:details-kill-buffer-command
|
|
|
|
:m "TAB" #'cfw:details-navi-prev-item-command
|
|
|
|
:m [tab] #'cfw:details-navi-prev-item-command
|
|
|
|
:m [backtab] #'cfw:details-navi-next-item-command
|
|
|
|
:m "q" #'cfw:details-kill-buffer-command
|
|
|
|
:m "C-h" #'cfw:details-navi-prev-command
|
|
|
|
:m "C-l" #'cfw:details-navi-prev-command
|
|
|
|
:m "C-j" #'cfw:details-navi-next-command
|
|
|
|
:m "C-k" #'cfw:details-navi-prev-command)))
|
2018-02-19 15:18:36 -05:00
|
|
|
|
2019-07-18 15:27:20 +02:00
|
|
|
(add-hook 'cfw:calendar-mode-hook #'doom-mark-buffer-as-real-h)
|
2021-03-06 00:06:54 -05:00
|
|
|
(add-hook 'cfw:calendar-mode-hook #'hide-mode-line-mode)
|
2018-02-19 15:18:36 -05:00
|
|
|
|
2019-07-23 12:30:47 +02:00
|
|
|
(advice-add #'cfw:render-button :override #'+calendar-cfw:render-button-a))
|
2018-02-19 15:18:36 -05:00
|
|
|
|
2018-01-13 17:26:40 +08:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! calfw-org
|
2018-01-13 17:26:40 +08:00
|
|
|
:commands (cfw:open-org-calendar
|
|
|
|
cfw:org-create-source
|
2020-07-29 11:55:44 +02:00
|
|
|
cfw:org-create-file-source
|
2018-01-13 17:26:40 +08:00
|
|
|
cfw:open-org-calendar-withkevin
|
|
|
|
my-open-calendar))
|
|
|
|
|
2021-03-06 00:06:54 -05:00
|
|
|
|
2020-07-29 22:01:19 +02:00
|
|
|
(use-package! calfw-cal
|
|
|
|
:commands (cfw:cal-create-source))
|
|
|
|
|
2021-03-06 00:06:54 -05:00
|
|
|
|
2020-06-14 18:31:29 -05:00
|
|
|
(use-package! calfw-ical
|
|
|
|
:commands (cfw:ical-create-source))
|
|
|
|
|
2018-02-19 15:18:36 -05:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! org-gcal
|
2021-03-06 00:06:54 -05:00
|
|
|
:defer t
|
2020-05-02 17:56:52 +12:00
|
|
|
:init
|
|
|
|
(defvar org-gcal-dir (concat doom-cache-dir "org-gcal/"))
|
|
|
|
(defvar org-gcal-token-file (concat org-gcal-dir "token.gpg"))
|
2018-01-13 17:26:40 +08:00
|
|
|
:config
|
|
|
|
;; hack to avoid the deferred.el error
|
|
|
|
(defun org-gcal--notify (title mes)
|
|
|
|
(message "org-gcal::%s - %s" title mes)))
|