about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2020-09-08 20:54:29 -0500
committerCase Duckworth2020-09-08 20:54:29 -0500
commita37d086a20b4df96da79047d9369aef43ba0108b (patch)
tree8c7db5402da91257b2f5e379486fca8afde5894c
parentVarious changes?? (diff)
downloademacs-a37d086a20b4df96da79047d9369aef43ba0108b.tar.gz
emacs-a37d086a20b4df96da79047d9369aef43ba0108b.zip
Rewrite .. again
-rw-r--r--early-init.el70
-rw-r--r--init.el881
2 files changed, 452 insertions, 499 deletions
diff --git a/early-init.el b/early-init.el index 0ec6fb9..5e28f4d 100644 --- a/early-init.el +++ b/early-init.el
@@ -1,65 +1,59 @@
1;;; early-init.el ~ acdw 1;;; early-init.el ~ acdw
2 2
3;;; different platforms 3;;; this needs to happen first -- speed up init
4(setq my/is-windows-p (eq system-type 'windows-nt) 4(setq gc-cons-threshold most-positive-fixnum)
5 my/is-linux-p (eq system-type 'gnu/linux) 5(defvar file-name-handler-alist-old file-name-handler-alist)
6 ;; TODO my/is-larry-p, my/is-bax-p (hostname) 6(setq file-name-handler-alist nil)
7 ) 7(setq message-log-max 16384)
8(setq byte-compile-warnings
9 '(not free-vars unresolved noruntime lexical make-local))
8 10
9(when my/is-windows-p 11(add-hook 'after-init-hook
10 (setenv "PATH" (concat "path/to/git" ";" (getenv "PATH")))) 12 (lambda ()
13 (setq file-name-handler-alist file-name-handler-alist-old)
14 (setq gc-cons-threshold (* 32 1024 1024)))
15 t)
11 16
17;;(setq debug-on-error t)
12 18
13;;; gui 19;;; different platforms
14(push '(tool-bar-lines . 0) default-frame-alist) 20(setq acdw/at-work (eq system-type 'windows-nt))
15(push '(menu-bar-lines . 0) default-frame-alist) 21(setq acdw/at-larry (string= (system-name) "larry"))
22(setq acdw/at-bax (string= (system-name) "bax"))
23
24;; this needs to be before bootstrapping straight.el
25(when acdw/at-work
26 (add-to-list 'exec-path "~/bin")
27 (add-to-list 'exec-path "C:/Users/aduckworth/Downloads/PortableGit/bin"))
16 28
17(unless (display-graphic-p) 29;;; gui
18 (tool-bar-mode -1) 30(add-to-list 'default-frame-alist '(tool-bar-lines . 0))
19 (menu-bar-mode -1)) 31(add-to-list 'default-frame-alist '(menu-bar-lines . 0))
20(scroll-bar-mode -1)
21(fringe-mode '(7 . 1))
22 32
23(setq inhibit-startup-buffer-menu t) 33(setq inhibit-startup-buffer-menu t)
24(setq inhibit-startup-screen t) 34(setq inhibit-startup-screen t)
25(setq inhibit-startup-echo-area-message "acdw")
26(setq initial-buffer-choice t) 35(setq initial-buffer-choice t)
27(setq initial-scratch-message nil) 36(setq initial-scratch-message nil)
28 37
29;;; straight.el ~ github.com/raxod502/straight.el 38;;; straight.el ~ github.com/raxod502/straight.el
30 39
31;; use use-package 40(setq straight-use-package-by-default t) ; use use-package
32(setq straight-use-package-by-default t) 41(setq use-package-hook-name-suffix nil) ; don't assume -hook
33 42
34;; boostrap straight.el 43;; bootstrap
35(defvar bootstrap-version) 44(defvar bootstrap-version)
36(let ((bootstrap-file 45(let ((bootstrap-file
37 (expand-file-name "straight/repos/straight.el/bootstrap.el" 46 (expand-file-name "straight/repos/straight.el/bootstrap.el"
38 user-emacs-directory)) 47 user-emacs-directory))
39 (bootstrap-version 5)) 48 (bootstrap-version 5))
40 (unless (file-exists-p bootstrap-file) 49 (unless (file-exists-p bootstrap-file)
41 (with-current-buffer 50 (with-current-buffer
42 (url-retrieve-synchronously 51 (url-retrieve-synchronously
43 "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" 52 "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
44 'silent 'inhibit-cookies) 53 'silent 'inhibit-cookies)
45 (goto-char (point-max)) 54 (goto-char (point-max))
46 (eval-print-last-sexp))) 55 (eval-print-last-sexp)))
47 (load bootstrap-file nil 'nomessage)) 56 (load bootstrap-file nil 'nomessage))
48 57
49;; install use-package with straight 58;; install use-package with straight
50(straight-use-package 'use-package) 59(straight-use-package 'use-package)
51
52;;; other init stuff
53
54(setq gc-cons-threshold (* 256 1024 1024))
55(defvar file-name-handler-alist-old file-name-handler-alist)
56(setq file-name-handler-alist nil)
57(setq message-log-max 16384)
58(setq byte-compile-warnings '(not free-vars unresolved noruntime lexical make-local))
59
60;; post-init
61(add-hook 'after-init-hook
62 (lambda ()
63 (setq file-name-handler-alist file-name-handler-alist-old)
64 (setq gc-cons-threshold (* 32 1024 1024)))
65 t)
diff --git a/init.el b/init.el index f6ce2c5..eae172a 100644 --- a/init.el +++ b/init.el
@@ -1,461 +1,420 @@
1;; init.el ~ acdw -*- lexical-binding: t -*- 1;;; init.el ~ acdw -*- lexical-binding: t -*-
2 2
3(server-start) 3;;; emacs configuration - general
4 4
5(setq confirm-kill-processes nil) 5(use-package emacs
6 6 :init
7(setq user-full-name "Case Duckworth") 7 (setq calendar-location-name "Baton Rouge, LA")
8(setq user-mail-address "acdw@acdw.net") 8 (setq calendar-latitude 30.39)
9(setq calendar-location-name "Baton Rouge, LA") 9 (setq calendar-longitude -91.83)
10(setq calendar-latitude 30.39) 10
11(setq calendar-longitude -91.83) 11 (setq browse-url-browser-function 'browse-url-generic)
12 12 (setq browse-url-generic-program "firefox"))
13(setq show-paren-style 'mixed) 13
14(show-paren-mode 1) 14(use-package auth-source
15 15 :init
16(setq backup-directory-alist 16 (setq auth-sources '("~/.authinfo")) ;; TODO: gpg
17 `((".*" . ,(concat user-emacs-directory "saves/")))) 17 (setq user-full-name "Case Duckworth")
18(setq delete-old-versions t) 18 (setq user-mail-address "acdw@acdw.net"))
19(setq kept-new-versions 6) 19
20(setq kept-old-versions 4) 20(use-package better-defaults
21(setq version-control t) 21 :config ; add other "better defaults" of my own
22 22 (when acdw/at-larry
23(setq auto-save-file-name-transforms 23 (setq visible-bell nil))
24 `((".*" ,(concat user-emacs-directory "saves/") t))) 24
25(auto-save-mode 1) 25 (setq version-control t)
26 26 (setq delete-old-versions t)
27(defun full-auto-save () 27 (setq kept-new-versions 6)
28 (interactive) 28 (setq kept-old-versions 4)
29 (save-excursion 29 (setq create-lockfiles nil)
30 (dolist (buf (buffer-list)) 30 (setq auto-save-file-name-transforms
31 (set-buffer buf) 31 `((".*" ,(concat user-emacs-directory "backups/") t)))
32 (if (and (buffer-file-name) (buffer-modified-p)) 32 (auto-save-mode)
33 (basic-save-buffer))))) 33
34(add-hook 'auto-save-hook 'full-auto-save) 34 (defun full-auto-save ()
35(add-hook 'focus-out-hook 'full-auto-save) ;; this might be resource intensive? 35 (interactive)
36 36 (save-excursion
37(setq save-place-file (expand-file-name "places" user-emacs-directory)) 37 (dolist (buf (buffer-list))
38(setq custom-file (expand-file-name "custom.el" user-emacs-directory)) 38 (set-buffer buf)
39 39 (if (and (buffer-file-name) (buffer-modified-p))
40(blink-cursor-mode 0) 40 (basic-save-buffer)))))
41 41 (add-hook 'auto-save-hook 'full-auto-save)
42(prefer-coding-system 'utf-8) 42 (add-hook 'focus-out-hook 'full-auto-save) ; might be resource-intensive
43(set-default-coding-systems 'utf-8) 43
44(set-terminal-coding-system 'utf-8) 44 ;; follow the split!
45(set-keyboard-coding-system 'utf-8) 45 (defun split-and-follow-below ()
46(fset 'yes-or-no-p 'y-or-n-p) 46 (interactive)
47(global-prettify-symbols-mode t) 47 (split-window-below)
48 48 (balance-windows)
49(save-place-mode 1) 49 (other-window 1))
50 50
51(global-visual-line-mode 1) 51 (defun split-and-follow-right ()
52 52 (interactive)
53(display-time-mode 1) 53 (split-window-right)
54(setq display-time-format "%R") 54 (balance-windows)
55 55 (other-window 1))
56(add-hook 'before-save-hook #'delete-trailing-whitespace) 56
57(add-hook 'prog-mode-hook 57 (setq save-place-file
58 (if (and (fboundp 'display-line-numbers-mode) 58 (expand-file-name "places" user-emacs-directory))
59 (display-graphic-p)) 59 (save-place-mode)
60 #'display-line-numbers-mode 60
61 #'linum-mode)) 61 (set-language-environment "UTF-8")
62 62 (prefer-coding-system 'utf-8)
63(setq uniquify-buffer-name-style 'forward) 63 (set-default-coding-systems 'utf-8)
64 64 (set-terminal-coding-system 'utf-8)
65(set-face-attribute 'default nil :font "GoMono Nerd Font-11") 65 (set-keyboard-coding-system 'utf-8)
66 66 (setq default-buffer-file-coding-system 'utf-8)
67(mouse-avoidance-mode 'jump) 67
68 68 (fset 'yes-or-no-p 'y-or-n-p)
69;;; Packages 69
70 70 (global-visual-line-mode)
71(use-package aggressive-indent 71 (mouse-avoidance-mode 'jump)
72 :hook 72 (setq show-paren-style 'mixed)
73 (prog-mode . aggressive-indent-mode)) 73
74 74 ;; TODO figure out how to add this to the :hook block
75(use-package async 75 (add-hook 'prog-mode-hook (if (and (fboundp 'display-line-numbers-mode)
76 :init (dired-async-mode 1)) 76 (display-graphic-p))
77 77 #'display-line-numbers-mode
78;; exwm 78 #'linum-mode))
79(use-package exwm 79
80 :demand 80 (setq completion-ignore-case t)
81 :custom 81 (setq read-buffer-completion-ignore-case t)
82 (exwm-layout-show-all-buffers t) 82 (setq read-file-name-completion-ignore-case t)
83 ;;(mouse-autoselect-window t) 83
84 (exwm-workspace-number 4) 84 ;; don't confirm death
85 (exwm-input-global-keys 85 (setq confirm-kill-processes nil)
86 `( 86 (setq confirm-kill-emacs nil)
87 ([?\s-r] . exwm-reset) 87
88 ([?\s-w] . exwm-workspace-switch) 88 ;; cursor betterment
89 ([?\s-&] . (lambda (command) 89 (blink-cursor-mode 0)
90 (interactive (list (read-shell-command "$ "))) 90 (setq cursor-type 'bar)
91 (start-process-shell-command command nil command))) 91
92 ,@(mapcar (lambda (i) 92 :bind
93 `(,(kbd (format "s-%d" i)) . 93 ([remap split-window-below] . split-and-follow-below)
94 (lambda () 94 ([remap split-window-right] . split-and-follow-right)
95 (interactive) 95
96 (exwm-workspace-switch-create ,i)))) 96 :hook
97 (number-sequence 0 9)))) 97 (auto-save-hook . full-auto-save)
98 (exwm-input-simulation-keys 98 (focus-out-hook . full-auto-save)
99 '(([?\C-b] . [left]) 99 (before-save-hook . delete-trailing-whitespace))
100 ([?\M-b] . [C-left]) 100
101 ([?\C-f] . [right]) 101(use-package auto-compile
102 ([?\M-f] . [C-right]) 102 :config
103 ([?\C-p] . [up]) 103 (auto-compile-on-load-mode)
104 ([?\C-n] . [down]) 104 (setq load-prefer-newer t))
105 ([?\C-a] . [home]) 105
106 ([?\C-e] . [end]) 106;; start the server when at home
107 ([?\M-v] . [prior]) 107
108 ([?\C-v] . [next]) 108(if (not acdw/at-work)
109 ([?\C-d] . [delete]) 109 (server-start))
110 ([?\C-k] . [S-end delete]) 110
111 ([?\C-s] . [?\C-f]) 111;;; quality-of-life improvements
112 ([?\C-w] . [?\C-x]) 112
113 ([?\M-w] . [?\C-c]) 113(use-package diminish)
114 ([?\C-y] . [?\C-v]))) 114
115 :hook 115(use-package which-key
116 ((exwm-update-class . 116 :diminish which-key-mode
117 (lambda () "Rename buffer to window's class name" 117 :config
118 (exwm-workspace-rename-buffer exwm-class-name))) 118 (which-key-mode))
119 (exwm-update-title . 119
120 (lambda () "Update workspace name to window title" 120(use-package recentf
121 (when (not exwm-instance-name) 121 :init
122 (exwm-workspace-rename-buffer exwm-title)))) 122 (setq recentf-max-menu-items 100)
123 (exwm-init . window-divider-mode) 123 (setq recentf-max-saved-items 100)
124 (exwm-init . 124 :config
125 (lambda () "Autostart" 125 (recentf-mode))
126 (start-process-shell-command "cmst" nil "cmst -m -w 5") 126
127 (start-process-shell-command "keepassxc" nil "keepassxc") 127(use-package savehist
128 (start-process-shell-command 128 :config
129 "pa-applet" nil 129 (savehist-mode))
130 "pa-applet --disable-key-grabbing --disable-notifications") 130
131 (start-process-shell-command "cbatticon" nil "cbatticon")))) 131(use-package restart-emacs)
132 :config 132
133 (require 'exwm) 133(use-package ivy
134 (exwm-enable) 134 :init
135 (require 'exwm-systemtray) 135 (setq ivy-use-virtual-buffers t)
136 (exwm-systemtray-enable)) 136 (setq ivy-wrap t)
137 137 (setq ivy-count-format "(%d/%d) ")
138(use-package exwm-firefox-core 138 (setq enable-recursive-minibuffers t)
139 :after exwm 139 (setq ivy-re-builders-alist
140 :straight (exwm-firefox-core 140 '((read-file-name-internal . ivy--regex-fuzzy)
141 :type git 141 (t . ivy--regex-plus)))
142 :host github 142 :bind
143 :repo "walseb/exwm-firefox-core")) 143 ("C-x b" . ivy-switch-buffer)
144 144 ("C-c v" . ivy-push-view)
145 (use-package exwm-firefox 145 ("C-c V" . ivy-pop-view)
146 :after exwm-firefox-core 146 ("C-c C-r" . ivy-resume)
147 :straight (exwm-firefox 147 :config
148 :type git 148 (ivy-mode))
149 :host github 149
150 :repo "ieure/exwm-firefox") 150(use-package swiper
151 :config 151 :bind
152 (exwm-firefox-mode)) 152 ("C-s" . swiper-isearch))
153 153
154(setq browse-url-browser-function 'browse-url-generic 154(use-package counsel ; includes ivy, counsel, swiper
155 browse-url-generic-program "firefox") 155 :bind
156 156 ("M-x" . counsel-M-x)
157(use-package exwm-mff 157 ("C-x C-f" . counsel-find-file)
158 :after exwm 158 ("M-y" . counsel-yank-pop)
159 :hook 159 ("<f1> f" . counsel-describe-function)
160 (exwm-init . exwm-mff-mode)) 160 ("<f1> v" . counsel-describe-variable)
161 161 ("<f1> l" . counsel-find-library)
162(use-package desktop-environment 162 ("<f2> i" . counsel-info-lookup-symbol)
163 :hook (exwm-init . desktop-environment-mode) 163 ("<f2> u" . counsel-unicode-char)
164 :custom 164 ("<f2> j" . counsel-set-variable)
165 (desktop-environment-update-exwm-global-keys :global) 165 ("C-c c" . counsel-compile)
166 (desktop-environment-brightness-get-command "light") 166 ("C-c g" . counsel-git)
167 (desktop-environment-brightness-set-command "light %s") 167 ("C-c j" . counsel-git-grep)
168 (desktop-environment-brightness-get-regexp "^\\([0-9]+\\)") 168 ("C-c L" . counsel-git-log)
169 (desktop-environment-brightness-normal-increment "-A 10") 169 ("C-c k" . counsel-rg)
170 (desktop-environment-brightness-normal-decrement "-U 10") 170 ("C-c m" . counsel-linux-app)
171 (desktop-environment-brightness-small-increment "-A 5") 171 ("C-c n" . counsel-fzf)
172 (desktop-environment-brightness-small-decrement "-U 5") 172 ("C-x l" . counsel-locate)
173 (desktop-environment-volume-get-command "pavolume get") 173 ("C-c J" . counsel-file-jump)
174 (desktop-environment-volume-set-command "pavolume %s") 174 ("C-S-o" . counsel-rhythmbox)
175 (desktop-environment-volume-toggle-command "pavolume mute toggle") 175 ("C-c w" . counsel-wmctrl)
176 (desktop-environment-volume-get-regexp "^\\([0-9]+\\)") 176 ("C-c b" . counsel-bookmark)
177 (desktop-environment-volume-normal-increment "inc 10") 177 ("C-c d" . counsel-descbinds)
178 (desktop-environment-volume-normal-decrement "dec 10") 178 ("C-c g" . counsel-git)
179 (desktop-environment-volume-small-increment "inc 5") 179 ("C-c o" . counsel-outline)
180 (desktop-environment-volume-small-decrement "dec 5")) 180 ("C-c t" . counsel-load-theme)
181 181 ("C-c F" . counsel-org-file))
182(use-package trashed 182
183 :custom 183(use-package ivy-rich
184 (delete-by-moving-to-trash t)) 184 :after ivy
185 185 :config
186(use-package switch-window 186 (ivy-rich-mode)
187 :custom 187 (setcdr (assq t ivy-format-functions-alist)
188 (switch-window-shortcut-style 'qwerty) 188 #'ivy-format-function-line))
189 :bind 189
190 ([remap other-window] . switch-window) 190(use-package avy
191 ("s-o" . switch-window)) 191 :bind
192 192 ("M-s" . avy-goto-char-timer)
193(defun split-and-follow-below () 193 :config
194 (interactive) 194 (use-package ivy-avy))
195 (split-window-below) 195
196 (balance-windows) 196;;; programming
197 (other-window 1)) 197
198(global-set-key [remap split-window-below] 'split-and-follow-below) 198(use-package aggressive-indent
199 199 :diminish aggressive-indent-mode
200(defun split-and-follow-right () 200 :hook
201 (interactive) 201 (prog-mode-hook . aggressive-indent-mode))
202 (split-window-right) 202
203 (balance-windows) 203(use-package magit
204 (other-window 1)) 204 :if (not acdw/at-work)
205(global-set-key [remap split-window-right] 'split-and-follow-right) 205 :bind
206 206 ("C-x g" . magit))
207;; modeline 207
208(use-package doom-modeline 208(use-package forge
209 :custom 209 :if (not acdw/at-work)
210 (doom-modeline-height 16) 210 :after magit
211 (doom-modeline-icon nil) 211 :custom
212 (doom-modeline-enable-word-count t) 212 (forge-owned-accounts '(("duckwork"))))
213 (doom-modeline-mu4e t) 213
214 (doom-modeline-gnus nil) 214(use-package company
215 (doom-modeline-irc t) 215 :commands company-mode
216 :custom-face 216 :init
217 (doom-modeline-vspc-face ((t (:inherit nil)))) 217 (setq company-idle-delay 0.1)
218 :config 218 :hook
219 (doom-modeline-mode t)) 219 (prog-mode-hook . company-mode)
220 220 :bind (:map company-active-map
221(use-package zoom 221 ("C-n" . company-select-next)
222 :custom 222 ("C-p" . company-select-previous))
223 (zoom-size '(0.618 . 0.618))) 223 :config
224 224 (use-package company-quickhelp
225;; themes 225 :hook
226(defun my/sunrise () 226 (company-mode . (lambda ()
227 (enable-theme 'modus-operandi) 227 (company-quickhelp-local-mode)))))
228 (start-process-shell-command "light" nil "light -S 60")) 228
229 229(use-package helpful
230(use-package modus-operandi-theme 230 :bind
231 :if window-system 231 ("C-h f" . helpful-callable)
232 :custom 232 ("C-h v" . helpful-variable)
233 (modus-operandi-theme-slanted-constructs t) 233 ("C-h k" . helpful-key)
234 (modus-operandi-theme-bold-constructs t) 234 ("C-c C-d" . helpful-at-point)
235 (modus-operandi-theme-3d-modeline t) 235 ("C-h F" . helpful-function)
236 :config 236 ("C-h C" . helpful-command)
237 (load-theme 'modus-operandi t t) 237 :custom
238 (run-at-time (nth 1 (split-string (sunrise-sunset))) 238 (counsel-describe-function-function #'helpful-callable)
239 (* 60 60 24) #'my/sunrise)) 239 (counsel-describe-variable-function #'helpful-variable))
240 240
241(defun my/sunset () 241(unless acdw/at-work
242 (enable-theme 'modus-vivendi) 242 (use-package su
243 (start-process-shell-command "light" nil "light -S 35")) 243 :config
244 244 (su-mode))
245(use-package modus-vivendi-theme 245
246 :if window-system 246 (use-package trashed
247 :custom 247 :init
248 (modus-vivendi-theme-slanted-constructs t) 248 (setq delete-by-moving-to-trash t)))
249 (modus-vivendi-theme-bold-constructs t) 249
250 (modus-vivendi-theme-3d-modeline t) 250;;; writing
251 :config 251
252 (load-theme 'modus-vivendi t t) 252(use-package visual-fill-column
253 (run-at-time (nth 4 (split-string (sunrise-sunset))) 253 :init
254 (* 60 60 24) #'my/sunset) 254 (setq split-window-preferred-function 'visual-fill-column-split-window-sensibly)
255 (run-at-time "12am" (* 60 60 24) #'my/sunset)) 255 (setq visual-fill-column-center-text t)
256 256 :config
257;; sudo 257 (advice-add 'text-scale-adjust
258(use-package su 258 :after #'visual-fill-column-adjust))
259 :config 259
260 (su-mode 1)) 260;;; window management
261 261
262;; minibuffer completion 262(use-package switch-window
263(use-package ivy 263 :init
264 :custom 264 (setq switch-window-shortcut-style 'qwerty)
265 (ivy-use-virtual-buffers t) 265 :bind
266 (ivy-wrap t) 266 ([remap other-window] . switch-window)
267 (ivy-count-format "(%d/%d) ") 267 ("s-o" . switch-window))
268 (enable-recursive-minibuffers t) 268
269 :config 269;;; theming and looks
270 (ivy-mode 1)) 270
271 271(use-package doom-modeline
272(use-package swiper 272 :init
273 :bind ("C-s" . swiper-isearch)) 273 (setq doom-modeline-icon nil)
274 274 (setq doom-modeline-enable-word-count t)
275(use-package counsel 275 (when acdw/at-larry
276 :config 276 (setq display-time-format "%R")
277 (counsel-mode 1)) 277 (display-time-mode))
278 278 :config
279(use-package ivy-rich 279 (doom-modeline-mode))
280 :after (ivy) 280
281 :config 281(when acdw/at-larry
282 (ivy-rich-mode 1) 282 (use-package statusbar
283 (setcdr (assq t ivy-format-functions-alist) #'ivy-format-function-line)) 283 :straight (statusbar
284 284 :host github
285(use-package ivy-avy) 285 :repo "dakra/statusbar.el")
286 286 :hook
287(use-package savehist 287 (exwm-init-hook . statusbar-mode)))
288 :config 288
289 (savehist-mode 1)) 289;; modus themes
290 290
291(use-package magit 291(use-package modus-operandi-theme
292 :bind 292 :if window-system
293 ("C-x g" . magit)) 293 :config
294 294 (load-theme 'modus-operandi t t)
295;; mu4e 295
296(progn 296 (defun acdw/sunrise ()
297 (require 'mu4e) 297 (enable-theme 'modus-operandi)
298 (require 'mu4e-contrib) 298 (start-process-shell-command "light" nil "light -S 60"))
299 (require 'smtpmail-async) 299
300 (setq mu4e-headers-skip-duplicates t) 300 (if acdw/at-work
301 (setq mu4e-view-show-images t) 301 (enable-theme 'modus-operandi)
302 (setq mu4e-view-show-addresses t) 302 (run-at-time (nth 1 (split-string (sunrise-sunset)))
303 (setq mu4e-compose-format-flowed t) 303 (* 60 60 24) #'acdw/sunrise)))
304 (setq mu4e-date-format "%Y-%m-%d") 304
305 (setq mu4e-headers-date-format "%Y-%m-%d") 305(unless acdw/at-work
306 (setq mu4e-change-filenames-when-moving t) 306 (use-package modus-vivendi-theme
307 (setq mu4e-attachments-dir "~/Downloads") 307 :if window-system
308 (setq message-kill-buffer-on-exit t) 308 :config
309 (setq mu4e-update-interval (* 60 60)) 309 (load-theme 'modus-vivendi t t)
310 (setq mu4e-maildir "~/Mail/fastmail") 310
311 (setq mu4e-refile-folder "/Archive") 311 (defun acdw/sunset ()
312 (setq mu4e-sent-folder "/Sent") 312 (enable-theme 'modus-vivendi)
313 (setq mu4e-drafts-folder "/Drafts") 313 (start-process-shell-command "light" nil "light -S 35"))
314 (setq mu4e-trash-folder "/Trash") 314
315 (setq message-send-mail-function 'async-smtpmail-send-it) 315 (run-at-time (nth 4 (split-string (sunrise-sunset)))
316 (setq smtpmail-default-smtp-server "smtp.fastmail.com") 316 (* 60 60 24) #'acdw/sunset)
317 (setq smtpmail-smtp-server "smtp.fastmail.com") 317 (run-at-time "12am" (* 60 60 24) #'acdw/sunset)))
318 (setq smtpmail-smtp-service 465) 318
319 (setq smtpmail-stream-type 'ssl) 319;;; gemini/gopher
320 (fset 'my-move-to-trash "mTrash") 320(use-package elpher
321 (define-key mu4e-headers-mode-map (kbd "d") 'my-move-to-trash) 321 :straight (elpher
322 (define-key mu4e-view-mode-map (kbd "d") 'my-move-to-trash)) 322 :repo "git://thelambdalab.xyz/elpher.git")
323 323 :bind (:map elpher-mode-map
324;; tramp 324 ("n" . 'elpher-next-link)
325(setq tramp-terminal-type "tramp") 325 ("p" . 'elpher-prev-link)))
326 326
327;; try packages out 327(use-package gemini-mode
328;(use-package try) 328 :straight (gemini-mode
329 329 :repo "https://git.carcosa.net/jmcbray/gemini.el.git"))
330;; vterm babeee 330
331;(use-package vterm) 331(use-package gemini-write
332 332 :straight (gemini-write
333(use-package which-key 333 :repo "https://alexschroeder.ch/cgit/gemini-write"))
334 :custom 334
335 (which-key-mode 1)) 335;;; exwm ~ Emacs X Window Manager
336 336(when acdw/at-larry
337(use-package company 337 (use-package exwm
338 :commands company-mode 338 :if window-system
339 :custom 339 :demand
340 (company-idle-delay 0.1) 340 :custom
341 :hook 341 (exwm-layout-show-all-buffers t)
342 (prog-mode . company-mode) 342 (exwm-workspace-warp-cursor t)
343 :bind (:map company-active-map 343 ;;(mouse-autoselect-window t)
344 ("C-n" . 'company-select-next) 344 (exwm-workspace-number 4)
345 ("C-p" . 'company-select-previous)) 345 (exwm-input-global-keys
346 :config 346 `(
347 (use-package company-quickhelp 347 ([?\s-r] . exwm-reset)
348 :hook 348 ([?\s-w] . exwm-workspace-switch)
349 (company-mode . (lambda () 349 ([?\s-&] . (lambda (command)
350 (company-quickhelp-local-mode))))) 350 (interactive (list (read-shell-command "$ ")))
351 351 (start-process-shell-command command nil command)))
352;;; gemini/gopher 352 ,@(mapcar (lambda (i)
353(use-package elpher 353 `(,(kbd (format "s-%d" i)) .
354 :straight (elpher 354 (lambda ()
355 :repo "git://thelambdalab.xyz/elpher.git") 355 (interactive)
356 :bind (:map elpher-mode-map 356 (exwm-workspace-switch-create ,i))))
357 ("n" . 'elpher-next-link) 357 (number-sequence 0 9))))
358 ("p" . 'elpher-prev-link))) 358 (exwm-input-simulation-keys
359 359 '(([?\C-b] . [left])
360 (use-package gemini-mode 360 ([?\M-b] . [C-left])
361 :straight (gemini-mode 361 ([?\C-f] . [right])
362 :repo "https://git.carcosa.net/jmcbray/gemini.el.git")) 362 ([?\M-f] . [C-right])
363 363 ([?\C-p] . [up])
364(use-package gemini-write 364 ([?\C-n] . [down])
365 :straight (gemini-write 365 ([?\C-a] . [home])
366 :repo "https://alexschroeder.ch/cgit/gemini-write")) 366 ([?\C-e] . [end])
367 367 ([?\M-v] . [prior])
368;;; better help messages 368 ([?\C-v] . [next])
369(use-package helpful 369 ([?\C-d] . [delete])
370 :bind 370 ([?\C-k] . [S-end delete])
371 ("C-h f" . helpful-callable) 371 ([?\C-s] . [?\C-f])
372 ("C-h v" . helpful-variable) 372 ([?\C-w] . [?\C-x])
373 ("C-h k" . helpful-key) 373 ([?\M-w] . [?\C-c])
374 ("C-c C-d" . helpful-at-point) 374 ([?\C-y] . [?\C-v])))
375 ("C-h F" . helpful-function) 375 :hook
376 ("C-h C" . helpful-command) 376 ((exwm-update-class-hook .
377 :custom 377 (lambda () "Rename buffer to window's class name"
378 (counsel-describe-function-function #'helpful-callable) 378 (exwm-workspace-rename-buffer exwm-class-name)))
379 (counsel-describe-variable-function #'helpful-variable)) 379 (exwm-update-title-hook .
380 380 (lambda () "Update workspace name to window title"
381;;; eshell 381 (when (not exwm-instance-name)
382;; ~ much from http://www.howardism.org/Technical/Emacs/eshell-fun.html 382 (exwm-workspace-rename-buffer exwm-title))))
383;;; TODO 383 (exwm-init-hook . window-divider-mode)
384 384 (exwm-init-hook .
385(use-package avy 385 (lambda () "Autostart"
386 :bind 386 (start-process-shell-command "cmst" nil "cmst -m -w 5")
387 ("M-s" . avy-goto-char)) 387 (start-process-shell-command "keepassxc" nil "keepassxc")
388 388 (start-process-shell-command
389(use-package rainbow-mode 389 "pa-applet" nil
390 :hook 390 "pa-applet --disable-key-grabbing --disable-notifications")
391 (prog-mode . rainbow-mode)) 391 (start-process-shell-command
392 392 "cbatticon" nil "cbatticon"))))
393(defun my/fetch-password (&rest params) 393 :config
394 "Fetch a password from auth-sources" 394 (require 'exwm)
395 (require 'auth-source) 395 (exwm-enable)
396 (let ((match (car (apply 'auth-source-search params)))) 396 (require 'exwm-systemtray)
397 (if match 397 (exwm-systemtray-enable))
398 (let ((secret (plist-get match :secret))) 398
399 (if (functionp secret) 399 (use-package exwm-firefox-core
400 (funcall secret) 400 :after exwm
401 secret)) 401 :straight (exwm-firefox-core
402 (error "Password not found for %S" params)))) 402 :type git
403 403 :host github
404(defun my/sasl-password (nick server) 404 :repo "walseb/exwm-firefox-core"))
405 "Fetch a password for $server and $nick" 405
406 (my/fetch-password :user nick :host server)) 406 (use-package exwm-firefox
407 407 :after exwm-firefox-core
408(use-package circe 408 :straight (exwm-firefox
409 :init 409 :type git
410 (require 'lui-autopaste) 410 :host github
411 (defun my/circe-prompt () 411 :repo "ieure/exwm-firefox")
412 (lui-set-prompt 412 :config
413 (concat (propertize (concat (buffer-name) ">") 413 (exwm-firefox-mode))
414 'face 'circe-prompt-face) 414
415 " "))) 415 (use-package exwm-mff
416 (defun my/lui-setup () 416 :straight (:repo "duckwork/exwm-mff")
417 (setq right-margin-width 5 417 :after exwm
418 fringes-outside-margins t 418 :hook
419 word-wrap t 419 (exwm-init-hook . exwm-mff-mode))
420 wrap-prefix " ") 420 ) ;; end of acdw/at-larry block
421 (setf (cdr (assoc 'continuation fringe-indicator-alist)) nil))
422 :hook
423 (circe-channel-mode . enable-lui-autopaste)
424 (circe-chat-mode-hook . my/circe-prompt)
425 (lui-mode-hook . my/circe-set-margin)
426 :custom
427 (circe-reduce-lurker-spam t)
428 (circe-format-say "{nick:-16s} {body}")
429 (lui-time-stamp-position 'right-margin)
430 (lui-fill-type nil)
431 (lui-time-stamp-format "%H:%M")
432 (lui-track-bar-behavior 'before-switch-to-buffer)
433 (circe-network-options
434 `(("Freenode"
435 :tls t
436 :port 6697
437 :nick "acdw"
438 :sasl-username "acdw"
439 :sasl-password ,(my/sasl-password "acdw" "irc.freenode.net")
440 :channels ("#emacs" "#daydreams"))
441 ("Tilde.chat"
442 :tls t
443 :port 6697
444 :nick "acdw"
445 :sasl-username "acdw"
446 :sasl-password ,(my/sasl-password "acdw" "irc.tilde.chat")
447 :channels ("#gemini" "#meta"))))
448 :custom-face
449 (circe-my-message-face ((t (:foreground "dark violet"))))
450 :config
451 (enable-lui-track-bar))
452
453;; elfeed
454(use-package elfeed
455 :custom
456 (elfeed-feeds
457 '("https://planet.emacslife.com/atom.xml")))
458
459(use-package smartparens
460 :config
461 (smartparens-global-mode))