This integrates the code behind the Dark Reader Chrome/Firefox extension with Nyxt.
BEWARE: it doesn’t work on Nyxt 2.*, as the APIs used belong to the 3.0 release and are only available on current master.
First, clone this repository:
# ~/.local/share/nyxt/extensions/nx-dark-reader is the extensions path.
# Change if you set it to a different value.
git clone https://github.com/aartaka/nx-dark-reader.git ~/.local/share/nyxt/extensions/nx-dark-reader
Then load it in your init file:
;;; ~/.config/nyxt/config.lisp
(define-nyxt-user-system-and-load "nyxt-user/dark-reader"
;; Remove this line if you don't need the file.
:components ("dark-reader.lisp")
:depends-on (:nx-dark-reader))
Optionally, configure it and add it to your default-modes
in dark-reader.lisp
(create the file if necessary).
;;; ~/.config/nyxt/dark-reader.lisp
(define-configuration nx-dark-reader:dark-reader-mode
;; Note the nxdr: short package prefix. It's for your convenience :)
((nxdr:brightness 80)
(nxdr:contrast 60)
(nxdr:text-color "white")))
;; Add dark-reader to default modes
(define-configuration web-buffer
((default-modes `(nxdr:dark-reader-mode ,@%slot-value%))))
And you’re all set! Enjoy your Dark Reader theme :)