From b1c7c35b677c922c4cd302b24d253533ee7006ef Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Tue, 27 Feb 2024 14:51:33 +0200 Subject: nyxt: Rewrite config.lisp --- .config/nyxt/config.lisp | 73 ++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/.config/nyxt/config.lisp b/.config/nyxt/config.lisp index eb70295..12e6b53 100644 --- a/.config/nyxt/config.lisp +++ b/.config/nyxt/config.lisp @@ -6,18 +6,19 @@ (when (probe-file quicklisp-init) (load quicklisp-init))) + + +(load "~/.config/nyxt/style.lisp") +(load "~/.config/nyxt/keys.lisp") +(load "~/.config/nyxt/default-search.lisp") + (defvar *web-buffer-modes* '(:emacs-mode ;; :blocker-mode :force-https-mode :reduce-tracking-mode :user-script-mode :bookmarklets-mode) "The modes to enable in any web-buffer by default. -Extension files (like dark-reader.lisp) are to append to this list. - -Why the variable? Because it's too much hassle copying it everywhere.") - -(define-nyxt-user-system-and-load nyxt-user/basic-config - :components ("keys" "style" "commands")) +Extension files (like dark-reader.lisp) are to append to this list.") (define-configuration (:modable-buffer :prompt-buffer :editor-buffer) "Set up Emacs keybindings everywhere possible." @@ -50,7 +51,7 @@ note that I made this feature so I want to have it :P)." :doc "This is to strip UTM-parameters off all the links. Upstream Nyxt doesn't have it because it may break some websites.") (preferred-user-agent - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36" + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15" :doc "Mimic Chrome on MacOS."))) @@ -74,32 +75,32 @@ Upstream Nyxt doesn't have it because it may break some websites.") url))) request-data) -(url-dispatching-handler 'old-reddit-handler ) - - -(define-configuration web-buffer - (request-resource-hook - (hooks:add-hook %slot-value% - (url-dispatching-handler - 'doi-link-dispatcher - (match-scheme "doi") - (lambda (url) - (quri:uri (format nil "https://www.reddit.com/~a" - (quri:uri-path url)))))))) - -(defmethod customize-instance ((buffer web-buffer)) - (hooks:add-hook - (request-resource-hook buffer) - (url-dispatching-handler - 'transmission-magnet-links - (match-scheme "magnet") - "transmission-remote --add ~a")) - (hooks:add-hook - (request-resource-hook buffer) - (url-dispatching-handler - 'emacs-file - (match-scheme "file") - (lambda (url) - (uiop:launch-program - `("emacs" ,(quri:uri-path url))) - nil)))) +;; (url-dispatching-handler 'old-reddit-handler ) + + +;; (define-configuration web-buffer +;; (request-resource-hook +;; (hooks:add-hook %slot-value% +;; (url-dispatching-handler +;; 'doi-link-dispatcher +;; (match-scheme "doi") +;; (lambda (url) +;; (quri:uri (format nil "https://www.reddit.com/~a" +;; (quri:uri-path url)))))))) + +;; (defmethod customize-instance ((buffer web-buffer)) +;; (hooks:add-hook +;; (request-resource-hook buffer) +;; (url-dispatching-handler +;; 'transmission-magnet-links +;; (match-scheme "magnet") +;; "transmission-remote --add ~a")) +;; (hooks:add-hook +;; (request-resource-hook buffer) +;; (url-dispatching-handler +;; 'emacs-file +;; (match-scheme "file") +;; (lambda (url) +;; (uiop:launch-program +;; `("emacs" ,(quri:uri-path url))) +;; nil)))) -- cgit v1.2.3