From 21885bb001f0a4e0ece7cdf90a79263e249225c2 Mon Sep 17 00:00:00 2001 From: FollieHiyuki Date: Sat, 13 Mar 2021 01:20:35 +0300 Subject: [PATCH] emacs: add mu4e, circe, mozc --- home/.config/doom/config.el | 22 ++++++++-- home/.config/doom/exwm.el | 42 +++++++++++++++++++- home/.config/doom/init.el | 4 +- home/.config/doom/packages.el | 1 + home/.config/nvim/general/basic-settings.vim | 2 +- home/.config/qutebrowser/config.py | 2 +- home/.mbsyncrc | 37 +++++++++++++++++ 7 files changed, 102 insertions(+), 8 deletions(-) create mode 100644 home/.mbsyncrc diff --git a/home/.config/doom/config.el b/home/.config/doom/config.el index b93a008..67745bb 100644 --- a/home/.config/doom/config.el +++ b/home/.config/doom/config.el @@ -8,6 +8,9 @@ (setq browse-url-browser-function 'browse-url-generic browse-url-generic-program "qutebrowser") +;; Secrets +(setq auth-sources '("~/.config/doom/.authinfo.gpg")) + ;; Font settings (setq doom-font (font-spec :family "Iosevka" :size 16) doom-serif-font (font-spec :family "Iosevka Slab" :size 16) @@ -34,12 +37,25 @@ '(font-lock-comment-face :slant italic) '(font-lock-keyword-face :weight bold)) +;; Japanese input method +(use-package! mozc + :config + (setq default-input-method "japanese-mozc")) +;; (use-package! mozc-cand-posframe +;; :after mozc +;; :config +;; (setq mozc-candidate-style 'posframe) +;; (custom-set-faces! +;; '(mozc-cand-posframe-normal-face :inherit tooltip) +;; '(mozc-cand-posframe-focused-face :inherit highlight) +;; '(mozc-cand-posframe-footer-face :inherit default))) + ;; Work around modeline cut off. See hlissner/doom-emacs#2967 (setq all-the-icons-scale-factor 1.0) (after! doom-modeline - ;; (custom-set-faces! - ;; '(mode-line :height 0.97) - ;; '(mode-line-inactive :height 0.97)) + (custom-set-faces! + '(mode-line :height 0.98) + '(mode-line-inactive :height 0.98)) (setq doom-modeline-major-mode-icon t doom-modeline-major-mode-color-icon t doom-modeline-unicode-fallback t)) diff --git a/home/.config/doom/exwm.el b/home/.config/doom/exwm.el index e929afa..791a99b 100644 --- a/home/.config/doom/exwm.el +++ b/home/.config/doom/exwm.el @@ -260,7 +260,6 @@ ;; Elpher (defun elpher--init-hook () (setq visual-fill-column-center-text t) - (font-lock-mode -1) (visual-fill-column-mode 1)) (use-package! elpher :defer t @@ -353,3 +352,44 @@ (interactive) (start-process-shell-command "greenclip" nil "pkill greenclip && greenclip clear") (follie/run-in-background "greenclip daemon")) + +;; mu4e +(use-package! mu4e + :commands mu4e mu4e-compose-new + :config + (setq mu4e-update-interval (* 10 60) + mu4e-view-image-max-width 600 + mu4e-context-policy 'always-ask + mu4e-compose-context-policy 'always-ask + mu4e-index-cleanup nil + mu4e-index-lazy-check t)) +(set-email-account! "Gmail" + '((mu4e-sent-folder . "/[Gmail]/Sent Mail") + (mu4e-drafts-folder . "/[Gmail]/Drafts") + (mu4e-trash-folder . "/[Gmail]/Trash") + (mu4e-refile-folder . "/[Gmail]/All Mail") + (smtpmail-smtp-user . "example@gmail.com") + (smtpmail-smtp-server . "smtp.gmail.com") + (smtpmail-smtp-service . 465) + (smtpmail-stream-type . ssl) + (user-full-name . "FGoogle") + (user-mail-address . "example@gmail.com") + (mu4e-compose-signature . "---\nfgoogle")) + t) + +;; circe +(defun my-fetch-password (&rest params) + (require 'auth-source) + (let ((match (car (apply #'auth-source-search params)))) + (if match + (let ((secret (plist-get match :secret))) + (if (functionp secret) + (funcall secret) + secret)) + (error "Password not found for %S" params)))) +(set-irc-server! "chat.freenode.net" + '(:tls t + :port 6697 + :nick "FollieHiyuki" + :sasl-password (my-fetch-password :user "FollieHiyuki" :host "irc.freenode.net") + :channels ("#voidlinux" "#river" "#archlinux" "#nixos"))) diff --git a/home/.config/doom/init.el b/home/.config/doom/init.el index 77de955..a714302 100644 --- a/home/.config/doom/init.el +++ b/home/.config/doom/init.el @@ -42,7 +42,7 @@ hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW ;;hydra indent-guides ; highlighted indent columns - (ligatures +extra); ligatures and symbols to make your code pretty again + ;;(ligatures +extra); ligatures and symbols to make your code pretty again ;;minimap ; show a map of the code on the side modeline ; snazzy, Atom-inspired modeline, plus API nav-flash ; blink cursor line after big motions @@ -208,7 +208,7 @@ (yaml +lsp) ; JSON, but readable :email - (mu4e +gmail) + (mu4e +org +gmail) ;;notmuch ;;(wanderlust +gmail) diff --git a/home/.config/doom/packages.el b/home/.config/doom/packages.el index 8263c5e..6144bfd 100644 --- a/home/.config/doom/packages.el +++ b/home/.config/doom/packages.el @@ -65,6 +65,7 @@ (package! nerd-fonts :recipe (:host github :repo "FollieHiyuki/nerd-fonts.el")) (package! ivy-emms) +;;(package! mozc-cand-posframe) ;;(package! 2048-game) ;;(package! org-ql) ;;(package! org-wild-notifier) diff --git a/home/.config/nvim/general/basic-settings.vim b/home/.config/nvim/general/basic-settings.vim index 1b4ab85..70e0f76 100644 --- a/home/.config/nvim/general/basic-settings.vim +++ b/home/.config/nvim/general/basic-settings.vim @@ -20,7 +20,7 @@ set noerrorbells set noshowmode set encoding=utf-8 set fileencoding=utf-8 -set iskeyword+=- " treat - as part of a word +" set iskeyword+=- " treat - as part of a word set formatoptions-=cro set clipboard+=unnamedplus set number relativenumber diff --git a/home/.config/qutebrowser/config.py b/home/.config/qutebrowser/config.py index 223f592..83f1e9e 100644 --- a/home/.config/qutebrowser/config.py +++ b/home/.config/qutebrowser/config.py @@ -11,7 +11,7 @@ config.source('base16-nord.py') # /____/ # Darkmode # c.colors.webpage.darkmode.enabled = True -c.colors.webpage.prefers_color_scheme_dark = True +c.colors.webpage.prefers_color_scheme = 'dark' # Confirm on quit c.confirm_quit = ['downloads', 'multiple-tabs'] diff --git a/home/.mbsyncrc b/home/.mbsyncrc new file mode 100644 index 0000000..4028c1d --- /dev/null +++ b/home/.mbsyncrc @@ -0,0 +1,37 @@ +# ---------------------------------- # +# Gmail # +# ---------------------------------- # + +IMAPAccount gmail +Host imap.gmail.com +User example@gmail.com +PassCmd "keepassxc-cli show -s ~/pass.kdbx Emails/Gmail | grep \"Password:\" | awk '{print $2}'" +Port 993 +AuthMechs LOGIN +SSLType IMAPS +#SSLVersions SSLv3 +CertificateFile /etc/ssl/certs/ca-certificates.crt + +# Remote +IMAPStore gmail-remote +Account gmail + +# Local +MaildirStore gmail-local +Subfolders Verbatim +Path ~/Mail/Gmail/ +Inbox ~/Mail/Gmail/Inbox + +# Connections +Channel gmail +Master :gmail-remote: +Slave :gmail-local: +Patterns ![Gmail]* "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" "[Gmail]/Trash" "[Gmail]/Drafts" "[Gmail]/Spam" "INBOX" +Create Slave +Expunge Both +SyncState * + +# ---------------------------------- # +# Self-hosted mail # +# ---------------------------------- # +# Soon