summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--init.el15
-rw-r--r--lisp/acdw.el34
2 files changed, 37 insertions, 12 deletions
diff --git a/init.el b/init.el index 86dca9a..45133df 100644 --- a/init.el +++ b/init.el
@@ -257,10 +257,6 @@
257 (:face aw-mode-line-face ((t (:foreground "red")))) 257 (:face aw-mode-line-face ((t (:foreground "red"))))
258 (+ace-window-display-mode +1)) 258 (+ace-window-display-mode +1))
259 259
260(setup (:straight acme-theme)
261 ;; (load-theme 'acme t)
262 )
263
264(setup (:straight anzu) 260(setup (:straight anzu)
265 (:option anzu-cons-mode-line-p nil) 261 (:option anzu-cons-mode-line-p nil)
266 (:+key [remap query-replace] 'anzu-query-replace-regexp 262 (:+key [remap query-replace] 'anzu-query-replace-regexp
@@ -295,16 +291,10 @@
295 (:hook-into eshell-mode 291 (:hook-into eshell-mode
296 comint-mode)) 292 comint-mode))
297 293
298(setup (:straight circadian)
299 (:option circadian-themes '((:sunrise . modus-operandi)
300 (:sunset . modus-vivendi)))
301 (add-hook 'after-init-hook 'circadian-setup))
302
303(setup (:straight circe) 294(setup (:straight circe)
304 (:require _circe 295 (:require _circe
305 +circe) 296 +circe)
306 (:also-load circe-chanop) 297 (:also-load circe-chanop)
307 ;;(autoload '+irc "+circe" "Connect to IRC." t)
308 298
309 ;; Formatting options 299 ;; Formatting options
310 (:option circe-format-action (format (format "%%%ds* {nick} {body}" 300 (:option circe-format-action (format (format "%%%ds* {nick} {body}"
@@ -386,7 +376,7 @@
386 (:option (append topsy-mode-functions) 376 (:option (append topsy-mode-functions)
387 '(circe-channel-mode . +circe-current-topic))) 377 '(circe-channel-mode . +circe-current-topic)))
388 378
389 (add-hook 'circadian-after-load-theme-hook 'circe-nick-color-reset) 379 (add-hook 'modus-themes-after-load-theme-hook 'circe-nick-color-reset)
390 (add-hook 'kill-emacs-hook '+circe-quit-all@kill-emacs)) 380 (add-hook 'kill-emacs-hook '+circe-quit-all@kill-emacs))
391 381
392(setup (:straight consult) 382(setup (:straight consult)
@@ -662,7 +652,8 @@ See also `crux-reopen-as-root-mode'."
662 (require 'modus-themes (.etc "straight/build/modus-themes/modus-themes")) 652 (require 'modus-themes (.etc "straight/build/modus-themes/modus-themes"))
663 (:option modus-themes-bold-constructs t 653 (:option modus-themes-bold-constructs t
664 modus-themes-italic-constructs t 654 modus-themes-italic-constructs t
665 modus-themes-headings '((t . (background))))) 655 modus-themes-headings '((t . (background))))
656 (+sunrise-sunset 'modus-themes-load-operandi 'modus-themes-load-vivendi))
666 657
667(setup (:straight mwim) 658(setup (:straight mwim)
668 (:+key "C-a" #'mwim-beginning 659 (:+key "C-a" #'mwim-beginning
diff --git a/lisp/acdw.el b/lisp/acdw.el index b13c9b6..0f78c79 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -42,5 +42,39 @@ the filesystem, unless INHIBIT-MKDIR is non-nil."
42 (make-directory (file-name-directory file-name) :parents)) 42 (make-directory (file-name-directory file-name) :parents))
43 file-name)))) 43 file-name))))
44 44
45
46(defun +suppress-messages (oldfn &rest args) ; from pkal
47 "Advice wrapper for suppressing `message'.
48OLDFN is the wrapped function, that is passed the arguments
49ARGS."
50 (let ((msg (current-message)))
51 (prog1
52 (let ((inhibit-message t))
53 (apply oldfn args))
54 (when msg
55 (message "%s" msg)))))
56
57
58(defun +sunrise-sunset (sunrise-command sunset-command)
59 "Run SUNRISE-COMMAND at sunrise, and SUNSET-COMMAND at sunset."
60 (let* ((times-regex (rx (* nonl)
61 (: (any ?s ?S) "unrise") " "
62 (group (repeat 1 2 digit) ":"
63 (repeat 1 2 digit)
64 (: (any ?a ?A ?p ?P) (any ?m ?M)))
65 (* nonl)
66 (: (any ?s ?S) "unset") " "
67 (group (repeat 1 2 digit) ":"
68 (repeat 1 2 digit)
69 (: (any ?a ?A ?p ?P) (any ?m ?M)))
70 (* nonl)))
71 (ss (+suppress-messages #'sunrise-sunset))
72 (_m (string-match times-regex ss))
73 (sunrise-time (match-string 1 ss))
74 (sunset-time (match-string 2 ss)))
75 (run-at-time sunrise-time (* 60 60 24) sunrise-command)
76 (run-at-time sunset-time (* 60 60 24) sunset-command)
77 (run-at-time "12:00am" (* 60 60 24) sunset-command))))
78
45(provide 'acdw) 79(provide 'acdw)
46;;; acdw.el ends here 80;;; acdw.el ends here