home

My NixOS systems configurations.
Log | Files | Refs | LICENSE

commit 69a9b4d5c106490942cea5ecdfb06b0fc8a18415
parent ec3ceea3b0df3c168513a456d9546435a0b74d7e
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Tue, 23 Jan 2024 12:55:57 +0100

tools/emacs: use org-portal to browse :)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Mtools/emacs/config/config-web.el | 26++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/tools/emacs/config/config-web.el b/tools/emacs/config/config-web.el @@ -73,15 +73,25 @@ defined keys follow the pattern of <PREFIX> <KEY>.") (use-package browse-url :after eww :config - (setq browse-url-generic-program "google-chrome-stable") + + (defun browse-url-xdg-desktop-portal (url &rest args) + "Open URL via a portal backend." + (dbus-call-method :session + "org.freedesktop.portal.Desktop" + "/org/freedesktop/portal/desktop" + "org.freedesktop.portal.OpenURI" + "OpenURI" + "" url '(:array :signature "{sv}"))) + (setopt browse-url-browser-function #'browse-url-xdg-desktop-portal) + ;; (setq browse-url-browser-function #'eww-browse-url) + + ;; (setq browse-url-generic-program "google-chrome-stable") (setq browse-url-handlers '(("^https://gitlab.com.*" . browse-url-firefox) - ("^https://github.com.*" . browse-url-generic) - ("^https://issues.redhat.com.*" . browse-url-generic) - ("^https://.*redhat.com.*" . browse-url-generic) - ("^https://docs.jboss.org.*" . browse-url-generic) - (".*" . eww-browse-url))) - (setq browse-url-browser-function #'eww-browse-url) - ) + ("^https://github.com.*" . browse-url-default-browser) + ("^https://issues.redhat.com.*" . browse-url-default-browser) + ("^https://.*redhat.com.*" . browse-url-default-browser) + ("^https://docs.jboss.org.*" . browse-url-default-browser) + (".*" . eww-browse-url)))) (provide 'config-web) ;;; config-web.el ends here