summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Ulmer <thomasmulmer02@gmail.com>2025-10-09 13:33:33 -0700
committerThomas Ulmer <thomasmulmer02@gmail.com>2025-10-09 13:33:33 -0700
commit062206bd54dbae464348c665a03224ae0acd3d6c (patch)
tree0879ccbe88cf226b7a32b2935167a7738f08cb32
parent905f78f330402e5558787a556ce7f6e9e55399f9 (diff)
mail, and conditional exwm
-rw-r--r--emacs/init.el97
1 files changed, 71 insertions, 26 deletions
diff --git a/emacs/init.el b/emacs/init.el
index e0eed83..72a40d6 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -88,9 +88,7 @@ mark. Does the same of ARG number sexps if given"
(defun my/close-or-kill ()
"If this is the sole frame, kill emacs. Otherwise close the frame."
(interactive)
- (if (eq 1 (length (frame-list)))
- (save-buffers-kill-terminal)
- (delete-frame)))
+ (save-buffers-kill-terminal))
(defun my/toggle-window-other-reachability ()
"Toggle whether this window can be selected by `other-window'."
@@ -434,12 +432,10 @@ given keymap or in the global keymap."
(add-hook 'completion-at-point-functions
'bash-completion-capf-nonexclusive nil t))))
-(use-package treemacs ; file explorer
- :bind (("C-c t" . treemacs)))
-
(use-package pass ; password integration
:demand t
:init
+ (pinentry-start)
(use-package password-store)
(use-package auth-source-pass :init (auth-source-pass-enable))
:custom
@@ -721,7 +717,7 @@ changes."
(defun my/browser ()
(interactive)
- (start-process-shell-command "firefox" nil "firefox"))
+ (start-process-shell-command "glide" nil "glide"))
(defun my/eshell (&optional arg)
(interactive "P")
@@ -743,10 +739,15 @@ changes."
(push ?\M-L exwm-input-prefix-keys)
(when (equal window-system 'x)
(exwm-enable))
+ (when (s-equals? (getenv "INSIDE_EXWM") "1")
+ (display-time-mode 1)
+ (display-battery-mode 1)
+ (ednc-mode 1))
:hook
(exwm-update-class . my/exwm-set-buffer-name)
(exwm-update-title . my/exwm-set-buffer-name)
:custom
+ (exwm-replace nil)
(exwm-title-length 50)
(exwm-workspace-show-all-buffers t)
(exwm-layout-show-all-buffers t)
@@ -926,6 +927,7 @@ changes."
(global-set-key (kbd "M-c") 'calc)
(global-set-key (kbd "M-U") 'scroll-lock-mode)
(global-set-key (kbd "M-Q") 'auto-fill-mode)
+(global-set-key (kbd "M-A") 'beginning-of-line-text)
(global-set-key (kbd "C-c r") 'raise-sexp)
(global-set-key (kbd "M-\"") 'my/activate-mark)
@@ -936,6 +938,8 @@ changes."
'(:name "other-window-indicator"))
+;; this stuff is conditionally activated by exwm
+
;; (use-package single-header
;; :ensure nil
;; :demand t
@@ -953,21 +957,74 @@ changes."
(use-package time
:demand t
:config
- (display-time-mode 1)
+ ;; (display-time-mode 1)
:custom
(display-time-day-and-date t)
(display-time-24hr-format t))
-
(use-package battery
:demand t
:config
- (display-battery-mode 1))
-
+ ;; (display-battery-mode 1)
+ )
(use-package ednc
:demand t
:config
- (when (eq window-system 'x)
- (ednc-mode 1)))
+ ;; (when (eq window-system 'x)
+ ;; (ednc-mode 1))
+ )
+
+(use-package mu4e
+ :ensure nil
+ :demand t
+ :init
+ ;; assumed Maildir layout
+ ;; ~/Maildir/Account0/{Inbox,Sent,Trash}
+ ;; ~/Maildir/Account1/{Inbox,Sent,Trash}
+ ;; where Account0 is context name
+ (defun my/make-mu4e-context (context-name full-name mail-address signature)
+ "Return a mu4e context named CONTEXT-NAME with :match-func matching
+ folder name CONTEXT-NAME in Maildir. The context's `user-mail-address',
+ `user-full-name' and `mu4e-compose-signature' is set to MAIL-ADDRESS
+ FULL-NAME and SIGNATURE respectively.
+ Special folders are set to context specific folders."
+ (let ((dir-name (concat "/" context-name)))
+ (make-mu4e-context
+ :name context-name
+ ;; we match based on the maildir of the message
+ ;; this matches maildir /Arkham and its sub-directories
+ :match-func
+ `(lambda (msg)
+ (when msg
+ (string-match-p
+ ,(concat "^" dir-name)
+ (mu4e-message-field msg :maildir))))
+ :vars
+ `((user-mail-address . ,mail-address)
+ (user-full-name . ,full-name)
+ (mu4e-sent-folder . ,(concat dir-name "/sent"))
+ (mu4e-drafts-folder . ,(concat dir-name "/drafts"))
+ (mu4e-trash-folder . ,(concat dir-name "/trash"))
+ (mu4e-refile-folder . ,(concat dir-name "/archive"))
+ (mu4e-compose-signature . ,signature)))))
+ :custom
+ (mu4e-change-filenames-when-moving t)
+ (mu4e-get-mail-command "mbsync --all")
+ :config
+ ;;Fixing duplicate UID errors when using mbsync and mu4e
+ (setq mu4e-contexts
+ `(,(my/make-mu4e-context
+ "thomasmulmer02" "Thomas Ulmer"
+ "thomasmulmer02@gmail.com" "Thanks,
+Thomas Ulmer")))
+
+ (require 'smtpmail)
+ (setq message-send-mail-function 'smtpmail-send-it)
+ (setq smtpmail-default-smtp-server "smtp.gmail.com"
+ smtpmail-smtp-server "smtp.gmail.com"
+ smtpmail-smtp-service 587
+ starttls-use-gnutls t
+ smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
+ smtp-auth-credentials (expand-file-name "~/.authinfo.gpg")))
;; ----------------------------------------------------------------------
@@ -1134,19 +1191,7 @@ changes."
'(gdb-non-stop-setting nil)
'(helm-minibuffer-history-key "M-p")
'(menu-bar-mode nil)
- '(package-selected-packages
- '(balanced-windows bash-completion benchmark-init cape consult
- corfu-terminal counsel-embark eat ednc
- eglot-tempel embark embark-consult
- embark-counsel esh-help evil-collection
- evil-easymotion evil-snipe evil-surround
- exwm-modeline fold-this free-keys haskell-mode
- hl-todo ibuffer-vc lsp-haskell magit marginalia
- minions ocp-indent orderless pass pyvenv
- racket-mode rustic sdcv shelldon
- sideline-flycheck sideline-flymake sideline-lsp
- tempel tempel-collection treemacs-evil vertico
- visible-mark vterm winum))
+ '(package-selected-packages nil)
'(pyim-assistant-scheme 'cangjie)
'(safe-local-variable-values '((LEXICAL-binding . t)))
'(scroll-bar-mode nil)