summaryrefslogtreecommitdiff
path: root/.config/emacs/modules/bd--browse.el
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-11-10 21:15:55 -0500
committerbd <bdunahu@operationnull.com>2025-11-10 21:15:55 -0500
commitb084f87e9e89a5312719b9cc229848221f1412f2 (patch)
tree425aad7f5a53eab22688a343f0ee971f8e6939d0 /.config/emacs/modules/bd--browse.el
parent49ab5c60c748974d05c39570a7c8bfdcdd128c98 (diff)
Use eww as default browser for ddg and searx, fix browse-url in eww
Diffstat (limited to '.config/emacs/modules/bd--browse.el')
-rw-r--r--.config/emacs/modules/bd--browse.el18
1 files changed, 12 insertions, 6 deletions
diff --git a/.config/emacs/modules/bd--browse.el b/.config/emacs/modules/bd--browse.el
index e9c73f9..4b78de2 100644
--- a/.config/emacs/modules/bd--browse.el
+++ b/.config/emacs/modules/bd--browse.el
@@ -12,6 +12,7 @@
(pcase pref
(0 (eww url))
(1 (start-process "torbrowser" nil "torbrowser" "--new-window" url))
+ (2 (start-process "chromium" nil "chromium" "--new-window" url))
(_ (start-process "browser" nil "librewolf" "--new-window" url))))
(defun bd/selector-bookmarks ()
@@ -63,17 +64,17 @@
(selector-source-create
"Browser"
:candidates
- (list (bd/search-candidate "SearXNG" "https://searx.operationnull.com/searxng/search?q=" 2)
- (bd/search-candidate "DuckDuckGo" "https://duckduckgo.com/html/?q=" 2)
- (bd/search-candidate "Wikipedia" "https://en.wikipedia.org/w/index.php?search=" 2)
- (bd/search-candidate "Invidious" "https://inv.nadeko.net/search?q=" 0)
- (bd/search-candidate "Urban Dictionary" "https://www.urbandictionary.com/define.php?term=" 2)
+ (list (bd/search-candidate "SearXNG" "https://searx.operationnull.com/searxng/search?q=" 0)
+ (bd/search-candidate "DuckDuckGo" "https://duckduckgo.com/html/?q=" 0)
+ (bd/search-candidate "Wikipedia" "https://en.wikipedia.org/w/index.php?search=" 3)
+ (bd/search-candidate "Invidious" "https://inv.nadeko.net/search?q=" 3)
+ (bd/search-candidate "Urban Dictionary" "https://www.urbandictionary.com/define.php?term=" 3)
(bd/search-candidate "Archive of Our Own" "https://archiveofourown.org/works/search?work_search%5Bquery%5D=" 0)
(bd/search-candidate "Archwiki" "https://wiki.archlinux.org/index.php?title=Special%3ASearch&search=" 0)
(bd/selector-rip-video)
(bd/search-candidate "Torbrowser" "" 1)
- (bd/search-candidate "Librewolf" "" 2))))
+ (bd/search-candidate "Librewolf" "" 3))))
(defun bd/browse-dispatcher ()
"Select and `browse-url' a bookmark or search feature."
@@ -117,6 +118,11 @@
(:map eww-mode-map
("i" . eww-toggle-images)
("o" . (lambda () (interactive) (rip-html (eww-current-url)))))
+ :hook
+ ;; eww-mode by default sets this as local var to eww-browse-url
+ ((eww-mode .
+ (lambda ()
+ (setq-local browse-url-browser-function #'bd/browse))))
:config
(setopt eww-search-prefix "https://searx.operationnull.com/searxng/search?q="
eww-auto-rename-buffer 'title