diff --git a/README.org b/README.org index 600201fc..d62f7181 100644 --- a/README.org +++ b/README.org @@ -14,6 +14,7 @@ - [[#undo-tree][Undo-Tree]] - [[#undo-fu][Undo-Fu]] - [[#better-ui][Better UI]] + - [[#eww][EWW]] - [[#completion][Completion]] - [[#yasnippet][YASnippet]] - [[#tempel][Tempel]] @@ -116,8 +117,8 @@ In order to have this config work on both my desktop with regular joe-schmoe mon "Set the frame to be transparent on Wayland compositors" (if (string-search "wayland" x-display-name) '((set-frame-parameter (selected-frame) 'alpha '(100 . 100)) - (add-to-list 'default-frame-alist '(alpha . (80 . 80))) - (add-to-list 'initial-frame-alist '(alpha . (80 . 80)))))) + (add-to-list 'default-frame-alist '(alpha . (100 . 100))) + (add-to-list 'initial-frame-alist '(alpha . (100 . 100)))))) (if (daemonp) (add-hook 'after-make-frame-functions @@ -139,8 +140,16 @@ Then let's make sure line-numbers are relative and on. And let's turn on visual- #+RESULTS: : t -Here are some ui changes I pulled from Doom Emacs +I'm adding a terminal to my workflow because sometimes that's better for me. #+begin_src emacs-lisp +(defun on-frame-open (frame) + (if (not (display-graphic-p frame)) + (set-face-background 'default "unspecified-bg" frame))) +(add-hook 'after-make-frame-functions 'on-frame-open) +#+end_src + +Here are some ui changes I pulled from Doom Emacs +,#+begin_src emacs-lisp ;; always avoid GUI (setq use-dialog-box nil) @@ -499,6 +508,7 @@ Let's start by creating a self contained function of what I'd like started on ev (display-line-numbers-mode -1) (variable-pitch-mode -1) (toggle-truncate-lines +1) + (evil-normal-state) (setq visual-fill-column-width 120 visual-fill-column-center-text t)) #+end_src @@ -517,7 +527,7 @@ Part of this config includes some special capture templates for my work as a you org-fontify-quote-and-verse-blocks t org-src-preserve-indentation t org-src-window-setup 'other-window - org-agenda-current-time-string "now >>>>>>>>>>>>>") + org-agenda-current-time-string "⭠ now ────────────────") (add-hook 'org-mode-hook 'chris/org-mode-setup) @@ -668,6 +678,7 @@ Part of this config includes some special capture templates for my work as a you "gC" 'chris/org-columns-view "ge" 'org-edit-src-code "gr" 'revert-buffer + "ze" 'org-emphasize "S" 'org-schedule "t" 'org-todo) ('insert org-mode-map @@ -837,8 +848,15 @@ Org-Superstar makes the stars at the beginning of the line in =org-mode= a lot p *** Org Modern #+BEGIN_SRC emacs-lisp :tangle no (use-package org-modern - :straight (:host github :repo "minad/org-modern")) + :straight (:host github :repo "minad/org-modern") + :config + + (custom-set-faces + '(org-moder-tag ((t :background "#9aedfe"))) + ) + ) #+END_SRC + *** Org DWIM I've stolen most of this code from Doom Emacs but we want to create a dwim-at-point function for Org-Mode that will fit under the =RET= key. This allows us to do a bunch of different functions depending on the context of point. #+begin_src emacs-lisp @@ -1104,6 +1122,13 @@ These two packages created by Prot are interesting to me and may help to make su tabulated-list-mode-hook))) #+end_src +** EWW +Builtin webbrowser for emacs. Trying it out as a text only browser for things. + +#+begin_src emacs-lisp + +#+end_src + ** Completion My completion framework is a combination of packages so that everything remains seperate and lightweight. @@ -1708,7 +1733,7 @@ Since I like to make my window manager handle a lot of the window management, I "Return non-nil if function SYM is autoloaded." (-when-let (file-name (buffer-file-name buf)) (setq file-name (s-chop-suffix ".gz" file-name)) - (help-fns--autoloaded-p sym))) + (help-fns--autoloaded-p sym file-name))) (defun helpful--skip-advice (docstring) "Remove mentions of advice from DOCSTRING." @@ -2102,9 +2127,12 @@ Ledger mode (mu4e-trash-folder . "/office/Deleted Items") (mu4e-refile-folder . "/office/Archive") (smtpmail-smtp-user . "chris@tfcconnection.org") + (smtpmail-starttls-credentials . '(("smtp.office365.com" 587 nil nil))) + (smtpmail-auth-credentials . '(("smtp.office365.com" 587 "chris@tfcconnection.org" nil))) + (smtpmail-smtp-server . "smtp.office365.com") (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun"))) (make-mu4e-context - :name "personal" + :name "outlook" :match-func (lambda (msg) (when msg @@ -2116,6 +2144,22 @@ Ledger mode (mu4e-refile-folder . "/outlook/Archive") (smtpmail-smtp-user . "chris.cochrun@outlook.com") (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun"))) + (make-mu4e-context + :name "personal" + :match-func + (lambda (msg) + (when msg + (string-prefix-p "/cochrun" (mu4e-message-field msg :maildir)))) + :vars '((user-mail-address . "chris@cochrun.xyz") + (mu4e-sent-folder . "/cochrun/Sent/") + (mu4e-drafts-folder . "/cochrun/Drafts") + (mu4e-trash-folder . "/cochrun/Trash") + (mu4e-refile-folder . "/cochrun/Archive") + (smtpmail-smtp-user . "chris@cochrun.xyz") + (smtpmail-starttls-credentials . '(("mail.cochrun.xyz" 587 nil nil))) + (smtpmail-auth-credentials . '(("mail.cochrun.xyz" 587 "chris@cochrun.xyz" nil))) + (smtpmail-smtp-server . "mail.cochrun.xyz") + (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun"))) (make-mu4e-context :name "gmail" :match-func @@ -2127,20 +2171,17 @@ Ledger mode (smtpmail-smtp-user . "ccochrun21@gmail.com") (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun"))))) - ;; Add the ability to send email for o365 + ;; Add the ability to send email (setq message-send-mail-function 'smtpmail-send-it starttls-use-gnutls t - smtpmail-starttls-credentials '(("smtp.office365.com" 587 nil nil)) - smtpmail-auth-credentials - '(("smtp.office365.com" 587 "chris@tfcconnection.org" nil)) - smtpmail-default-smtp-server "smtp.office365.com" - smtpmail-smtp-server "smtp.office365.com" + smtpmail-default-smtp-server "mail.cochrun.xyz" smtpmail-smtp-service 587) ;; shortcuts in the jumplist by pressing "J" in the mu4e buffer (setq mu4e-maildir-shortcuts '((:maildir "/office/Archive" :key ?a) (:maildir "/office/INBOX" :key ?i) + (:maildir "/cochrun/INBOX" :key ?p) (:maildir "/outlook/INBOX" :key ?l) (:maildir "/office/Junk Email" :key ?j) (:maildir "/office/INBOX/Website Forms" :key ?f) @@ -2570,6 +2611,35 @@ interfere with the default `bongo-playlist-buffer'." (if enclosure "podcast" "video") (propertize title 'face 'italic) (propertize bongo-pl 'face 'bold)))) + + (defun chris/elfeed-bongo-insert-link () + "Inserts the hovered link into bongo for playback in mpv" + (interactive) + (let* ((link (shr--current-link-region)) + (entry elfeed-show-entry) + (title (elfeed-entry-title entry)) + (url (get-text-property (point) 'shr-url)) + (bongo-pl chris/elfeed-bongo-playlist) + (buffer (get-buffer-create bongo-pl))) + (message "url is %s" url) + (message "title is %s" title) + (unless (bongo-playlist-buffer) + (bongo-playlist-buffer)) + (display-buffer buffer) + (with-current-buffer buffer + (when (not (bongo-playlist-buffer-p)) + (bongo-playlist-mode) + (setq-local bongo-library-buffer (get-buffer "*elfeed-search*")) + (setq-local bongo-enabled-backends '(mpv)) + (bongo-progressive-playback-mode)) + (goto-char (point-max)) + (bongo-insert-uri url (format "%s ==> %s" title url)) + (let ((inhibit-read-only t)) + (delete-duplicate-lines (point-min) (point-max))) + (bongo-recenter)) + (message "Enqueued item “%s” in %s" + (propertize title 'face 'italic) + (propertize bongo-pl 'face 'bold)))) (defun chris/elfeed-bongo-switch-to-playlist () (interactive) @@ -2595,6 +2665,8 @@ interfere with the default `bongo-playlist-buffer'." (add-hook 'elfeed-search-mode-hook 'chris/elfeed-ui-setup) (add-hook 'elfeed-show-mode-hook 'chris/elfeed-show-ui-setup) + (setq shr-use-colors nil) + :general (chris/leader-keys :states 'normal diff --git a/init.el b/init.el index 00286a04..c296b2e4 100644 --- a/init.el +++ b/init.el @@ -40,8 +40,8 @@ "Set the frame to be transparent on Wayland compositors" (if (string-search "wayland" x-display-name) '((set-frame-parameter (selected-frame) 'alpha '(100 . 100)) - (add-to-list 'default-frame-alist '(alpha . (80 . 80))) - (add-to-list 'initial-frame-alist '(alpha . (80 . 80)))))) + (add-to-list 'default-frame-alist '(alpha . (100 . 100))) + (add-to-list 'initial-frame-alist '(alpha . (100 . 100)))))) (if (daemonp) (add-hook 'after-make-frame-functions @@ -55,18 +55,10 @@ (add-hook 'prog-mode-hook (display-line-numbers-mode +1)) (global-visual-line-mode +1) -;; always avoid GUI -(setq use-dialog-box nil) -;; Don't display floating tooltips; display their contents in the echo-area, -;; because native tooltips are ugly. -(when (bound-and-true-p tooltip-mode) - (tooltip-mode -1)) -;; ...especially on linux -(setq x-gtk-use-system-tooltips nil) - - ;; Favor vertical splits over horizontal ones. Screens are usually wide. -(setq split-width-threshold 160 - split-height-threshold nil) +(defun on-frame-open (frame) + (if (not (display-graphic-p frame)) + (set-face-background 'default "unspecified-bg" frame))) +(add-hook 'after-make-frame-functions 'on-frame-open) (setq doc-view-resolution 192) @@ -323,6 +315,7 @@ (display-line-numbers-mode -1) (variable-pitch-mode -1) (toggle-truncate-lines +1) + (evil-normal-state) (setq visual-fill-column-width 120 visual-fill-column-center-text t)) @@ -336,7 +329,7 @@ org-fontify-quote-and-verse-blocks t org-src-preserve-indentation t org-src-window-setup 'other-window - org-agenda-current-time-string "now >>>>>>>>>>>>>") + org-agenda-current-time-string "⭠ now ────────────────") (add-hook 'org-mode-hook 'chris/org-mode-setup) @@ -487,6 +480,7 @@ "gC" 'chris/org-columns-view "ge" 'org-edit-src-code "gr" 'revert-buffer + "ze" 'org-emphasize "S" 'org-schedule "t" 'org-todo) ('insert org-mode-map @@ -808,6 +802,8 @@ If on a: (use-package toc-org :after org) + + (use-package vertico :init (vertico-mode) @@ -1204,7 +1200,7 @@ targets." "Return non-nil if function SYM is autoloaded." (-when-let (file-name (buffer-file-name buf)) (setq file-name (s-chop-suffix ".gz" file-name)) - (help-fns--autoloaded-p sym))) + (help-fns--autoloaded-p sym file-name))) (defun helpful--skip-advice (docstring) "Remove mentions of advice from DOCSTRING." @@ -1445,9 +1441,12 @@ targets." (mu4e-trash-folder . "/office/Deleted Items") (mu4e-refile-folder . "/office/Archive") (smtpmail-smtp-user . "chris@tfcconnection.org") + (smtpmail-starttls-credentials . '(("smtp.office365.com" 587 nil nil))) + (smtpmail-auth-credentials . '(("smtp.office365.com" 587 "chris@tfcconnection.org" nil))) + (smtpmail-smtp-server . "smtp.office365.com") (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun"))) (make-mu4e-context - :name "personal" + :name "outlook" :match-func (lambda (msg) (when msg @@ -1459,6 +1458,22 @@ targets." (mu4e-refile-folder . "/outlook/Archive") (smtpmail-smtp-user . "chris.cochrun@outlook.com") (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun"))) + (make-mu4e-context + :name "personal" + :match-func + (lambda (msg) + (when msg + (string-prefix-p "/cochrun" (mu4e-message-field msg :maildir)))) + :vars '((user-mail-address . "chris@cochrun.xyz") + (mu4e-sent-folder . "/cochrun/Sent/") + (mu4e-drafts-folder . "/cochrun/Drafts") + (mu4e-trash-folder . "/cochrun/Trash") + (mu4e-refile-folder . "/cochrun/Archive") + (smtpmail-smtp-user . "chris@cochrun.xyz") + (smtpmail-starttls-credentials . '(("mail.cochrun.xyz" 587 nil nil))) + (smtpmail-auth-credentials . '(("mail.cochrun.xyz" 587 "chris@cochrun.xyz" nil))) + (smtpmail-smtp-server . "mail.cochrun.xyz") + (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun"))) (make-mu4e-context :name "gmail" :match-func @@ -1470,20 +1485,17 @@ targets." (smtpmail-smtp-user . "ccochrun21@gmail.com") (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun"))))) - ;; Add the ability to send email for o365 + ;; Add the ability to send email (setq message-send-mail-function 'smtpmail-send-it starttls-use-gnutls t - smtpmail-starttls-credentials '(("smtp.office365.com" 587 nil nil)) - smtpmail-auth-credentials - '(("smtp.office365.com" 587 "chris@tfcconnection.org" nil)) - smtpmail-default-smtp-server "smtp.office365.com" - smtpmail-smtp-server "smtp.office365.com" + smtpmail-default-smtp-server "mail.cochrun.xyz" smtpmail-smtp-service 587) ;; shortcuts in the jumplist by pressing "J" in the mu4e buffer (setq mu4e-maildir-shortcuts '((:maildir "/office/Archive" :key ?a) (:maildir "/office/INBOX" :key ?i) + (:maildir "/cochrun/INBOX" :key ?p) (:maildir "/outlook/INBOX" :key ?l) (:maildir "/office/Junk Email" :key ?j) (:maildir "/office/INBOX/Website Forms" :key ?f) @@ -1844,6 +1856,35 @@ interfere with the default `bongo-playlist-buffer'." (if enclosure "podcast" "video") (propertize title 'face 'italic) (propertize bongo-pl 'face 'bold)))) + + (defun chris/elfeed-bongo-insert-link () + "Inserts the hovered link into bongo for playback in mpv" + (interactive) + (let* ((link (shr--current-link-region)) + (entry elfeed-show-entry) + (title (elfeed-entry-title entry)) + (url (get-text-property (point) 'shr-url)) + (bongo-pl chris/elfeed-bongo-playlist) + (buffer (get-buffer-create bongo-pl))) + (message "url is %s" url) + (message "title is %s" title) + (unless (bongo-playlist-buffer) + (bongo-playlist-buffer)) + (display-buffer buffer) + (with-current-buffer buffer + (when (not (bongo-playlist-buffer-p)) + (bongo-playlist-mode) + (setq-local bongo-library-buffer (get-buffer "*elfeed-search*")) + (setq-local bongo-enabled-backends '(mpv)) + (bongo-progressive-playback-mode)) + (goto-char (point-max)) + (bongo-insert-uri url (format "%s ==> %s" title url)) + (let ((inhibit-read-only t)) + (delete-duplicate-lines (point-min) (point-max))) + (bongo-recenter)) + (message "Enqueued item “%s” in %s" + (propertize title 'face 'italic) + (propertize bongo-pl 'face 'bold)))) (defun chris/elfeed-bongo-switch-to-playlist () (interactive) @@ -1869,6 +1910,8 @@ interfere with the default `bongo-playlist-buffer'." (add-hook 'elfeed-search-mode-hook 'chris/elfeed-ui-setup) (add-hook 'elfeed-show-mode-hook 'chris/elfeed-show-ui-setup) + (setq shr-use-colors nil) + :general (chris/leader-keys :states 'normal @@ -2101,20 +2144,3 @@ interfere with the default `bongo-playlist-buffer'." gcmh-verbose nil)) (setq warning-suppress-types '((comp))) -(custom-set-variables - ;; custom-set-variables was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(pdf-misc-print-program "/usr/bin/lpr" t) - '(pdf-misc-print-program-args '("-o media=Letter" "-o fitplot") t) - '(safe-local-variable-values - '((aggressive-indent-mode) - (projectile-project-run-cmd . "./build/bin/presenter") - (projectile-project-compilation-cmd . "cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -B build/ . && make --dir build/")))) -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - )