diff options
author | Case Duckworth | 2021-06-30 19:37:42 -0500 |
---|---|---|
committer | Case Duckworth | 2021-06-30 19:37:42 -0500 |
commit | 3633bacb94947fca9c07f022e607375ff7c1d73e (patch) | |
tree | 3ca5c84bb979727b203717e31f54ce6fa43b4c1b | |
parent | Start week on Monday (diff) | |
parent | Merge branch 'main' of https://tildegit.org/acdw/emacs (diff) | |
download | emacs-3633bacb94947fca9c07f022e607375ff7c1d73e.tar.gz emacs-3633bacb94947fca9c07f022e607375ff7c1d73e.zip |
Merge branch 'main' of tildegit.org:acdw/emacs
-rw-r--r-- | init.el | 68 |
1 files changed, 61 insertions, 7 deletions
diff --git a/init.el b/init.el index e7ef20c..d1e81fe 100644 --- a/init.el +++ b/init.el | |||
@@ -86,12 +86,51 @@ | |||
86 | browse-url-firefox-arguments '("--new-tab") ; for firefox | 86 | browse-url-firefox-arguments '("--new-tab") ; for firefox |
87 | browse-url-firefox-new-window-is-tab t) | 87 | browse-url-firefox-new-window-is-tab t) |
88 | 88 | ||
89 | (defvar browse-url-mpv-arguments nil | ||
90 | "Arguments to pass to mpv in `browse-url-mpv'.") | ||
91 | |||
92 | (defun browse-url-mpv (url &optional new-window) | ||
93 | "Play `URL' in mpv." | ||
94 | (interactive (browse-url-interactive-arg "Video URL: ")) | ||
95 | (ignore new-window) ;; mpv always opens a new window | ||
96 | (let* ((url (browse-url-encode-url url)) | ||
97 | (process-environment (browse-url-process-environment))) | ||
98 | (message "Playing %s in mpv..." url) | ||
99 | (apply #'start-process | ||
100 | (concat "mpv " url) nil | ||
101 | "mpv" | ||
102 | (append | ||
103 | browse-url-mpv-arguments | ||
104 | (list url))))) | ||
105 | |||
106 | (defvar browse-url-feh-arguments '("--auto-zoom" | ||
107 | "--geometry" "800x600") | ||
108 | "Arguments to pass to feh in `browse-url-feh'.") | ||
109 | |||
110 | (defun browse-url-feh (url &optional new-window) | ||
111 | "Open `URL' in feh." | ||
112 | (interactive (browse-url-interactive-arg "Video URL: ")) | ||
113 | (ignore new-window) ;; mpv always opens a new window | ||
114 | (let* ((url (browse-url-encode-url url)) | ||
115 | (process-environment (browse-url-process-environment))) | ||
116 | (message "Opening %s in feh..." url) | ||
117 | (apply #'start-process | ||
118 | (concat "feh " url) nil | ||
119 | "feh" | ||
120 | (append | ||
121 | browse-url-feh-arguments | ||
122 | (list url))))) | ||
123 | |||
89 | ;; `browse-url-browser-function' as an alist is deprecated in Emacs 28 for | 124 | ;; `browse-url-browser-function' as an alist is deprecated in Emacs 28 for |
90 | ;; `browse-url-handlers'. | 125 | ;; `browse-url-handlers'. |
91 | (set-default (if (version<= emacs-version "28") | 126 | (set-default (if (version<= emacs-version "28") |
92 | 'browse-url-browser-function | 127 | 'browse-url-browser-function |
93 | 'browse-url-handlers) | 128 | 'browse-url-handlers) |
94 | '(("." . eww-browse-url))) | 129 | `(,(when (executable-find "feh") |
130 | '("\\.jpe?g\\'" . browse-url-feh)) | ||
131 | ,(when (executable-find "mpv") | ||
132 | '("youtube\\.com\\|youtu\\.be" . browse-url-mpv)) | ||
133 | ("." . eww-browse-url))) | ||
95 | 134 | ||
96 | ;; Buttonize gemini:// links. | 135 | ;; Buttonize gemini:// links. |
97 | (acdw/add-button-url-regexp-protocol "gemini")) | 136 | (acdw/add-button-url-regexp-protocol "gemini")) |
@@ -302,12 +341,23 @@ | |||
302 | 341 | ||
303 | (:bind "C-c C-b" acdw-erc/erc-switch-to-buffer) | 342 | (:bind "C-c C-b" acdw-erc/erc-switch-to-buffer) |
304 | 343 | ||
305 | ;; (setup (:straight erc-hl-nicks) | 344 | (with-eval-after-load 'erc |
306 | ;; (with-eval-after-load 'erc | 345 | (setup (:straight erc-hl-nicks) |
307 | ;; (require 'erc-hl-nicks) | 346 | (:option (append erc-modules) 'hl-nicks |
308 | ;; (:option erc-hl-nicks-minimum-contrast-ratio 4.5) | 347 | erc-hl-nicks-minimum-contrast-ratio 4.5 |
309 | ;; (:hook-into erc-mode))) | 348 | erc-hl-nicks-color-contrast-strategy '(invert contrast)) |
310 | ) | 349 | (:hook-into erc-mode) |
350 | ;; Refresh nick colors after changing modus theme | ||
351 | ;; Ideally, there'd be a hook for /any/ time we changed theme... but | ||
352 | ;; whatever. | ||
353 | (add-hook 'modus-themes-after-load-theme-hook | ||
354 | #'erc-hl-nicks-refresh-colors)) | ||
355 | |||
356 | (setup (:straight erc-image) | ||
357 | (:option (append erc-modules) 'image | ||
358 | erc-image-inline-rescale 'window)) | ||
359 | |||
360 | (erc-update-modules))) | ||
311 | 361 | ||
312 | (setup eshell | 362 | (setup eshell |
313 | (:also-load acdw-eshell | 363 | (:also-load acdw-eshell |
@@ -407,6 +457,10 @@ like a dumbass." | |||
407 | gnus-init-file (expand-file-name "gnus.el" user-emacs-directory)) | 457 | gnus-init-file (expand-file-name "gnus.el" user-emacs-directory)) |
408 | (:global "C-c n" gnus)) | 458 | (:global "C-c n" gnus)) |
409 | 459 | ||
460 | (setup goto-addr | ||
461 | (add-hook 'text-mode-hook #'goto-address-mode) | ||
462 | (add-hook 'prog-mode-hook #'goto-address-prog-mode)) | ||
463 | |||
410 | (setup ibuffer | 464 | (setup ibuffer |
411 | (:option ibuffer-saved-filter-groups | 465 | (:option ibuffer-saved-filter-groups |
412 | '(("default" | 466 | '(("default" |