Oh I need no credits, I did nothing and it’s going to take decades before I know how to achieve what I want to do in common lisp!
There is no repository for it yet, but I continued customizing a bit to my own preferences based on your nice base. It looks like that for now:
This is the current diff:
diff --git a/tmp/drgn.nyxt/auto-config.lisp b/home/user/.config/nyxt/auto-config.lisp
index 139597f..5e259c1 100644
--- a/tmp/drgn.nyxt/auto-config.lisp
+++ b/home/user/.config/nyxt/auto-config.lisp
@@ -1,2 +1,11 @@
+(DEFINE-CONFIGURATION BUFFER
+ ((DEFAULT-MODES (APPEND '(NYXT::EMACS-MODE) %SLOT-DEFAULT%))))
+(DEFINE-CONFIGURATION BUFFER
+ ((DEFAULT-MODES %SLOT-DEFAULT%)))
+(DEFINE-CONFIGURATION BUFFER
+ ((DEFAULT-MODES (APPEND '(NYXT::VI-NORMAL-MODE) %SLOT-DEFAULT%))))
+(DEFINE-CONFIGURATION PROMPT-BUFFER
+ ((DEFAULT-MODES (APPEND '(NYXT::VI-INSERT-MODE) %SLOT-DEFAULT%))))
+
diff --git a/tmp/drgn.nyxt/base/commands.lisp b/home/user/.config/nyxt/base/commands.lisp
index c1d3bc3..cc1c923 100644
--- a/tmp/drgn.nyxt/base/commands.lisp
+++ b/home/user/.config/nyxt/base/commands.lisp
@@ -1,10 +1,5 @@
(in-package #:nyxt-user)
-;;runs shutdown -h now
-(define-command-global no-mercy ()
- "shutdown, with no mercy."
- (uiop:run-program "~/.config/nyxt/scripts/shutdown.sh"))
-
;;shows current time
(define-command-global current-time ()
"Show the current time."
@@ -15,11 +10,6 @@
"Show the weather for current location in message area."
(echo (uiop:run-program "~/.config/nyxt/scripts/weather.sh" :output :string)))
-;;runs script to open spotify and set the window
-(define-command-global open-spotify ()
- "Open Spotify."
- (uiop:run-program "~/.config/nyxt/scripts/spotify.sh"))
-
;;command to close nyxt and delete history file | investigating below issues
;;currently cannot be last command in this list and won't show in commands list so setting a keybinding is necessary
(define-command-global quit-history ()
@@ -27,7 +17,27 @@
(history-path (current-buffer))))
(quit))
-;;opens current url in different browser replace firefox with your browser/path
-(define-command-global open-external-browser ()
- "Open the current url in external browser"
+;;use kakoune as external-editor
+(define-configuration browser
+ ((external-editor-program (list "/usr/bin/kitty" "--name" "floating" "/usr/local/bin/kak"))))
+
+;;opens current url in different programs
+(define-command-global open-in-firefox ()
+ "Open the current URL in Firefox"
(uiop:run-program (list "firefox" (render-url (url (current-buffer))))))
+
+(define-command-global open-in-chromium ()
+ "Open the current URL in Chromium"
+ (uiop:run-program (list "chromium" (render-url (url (current-buffer))))))
+
+(define-command-global open-in-w3m ()
+ "Open the current URL in w3m"
+ (uiop:run-program (list "kitty" "w3m" (render-url (url (current-buffer))))))
+
+(define-command-global open-in-lynx ()
+ "Open the current URL in lynx"
+ (uiop:run-program (list "kitty" "lynx" (render-url (url (current-buffer))))))
+
+(define-command-global open-in-kakoune ()
+ "Edit the current text field in kakoune"
+ (uiop:run-program (list "kitty" "--name" "floating" "kak" (render-url (url (current-buffer))))))
diff --git a/home/user/.config/nyxt/base/domainrules.lisp b/home/user/.config/nyxt/base/domainrules.lisp
new file mode 100644
index 0000000..6fd3763
--- /dev/null
+++ b/home/user/.config/nyxt/base/domainrules.lisp
@@ -0,0 +1,16 @@
+;; HANDLERS
+(defparameter old-reddit-handler
+ (url-dispatching-handler
+ 'old-reddit-dispatcher
+ (match-host "www.reddit.com")
+ (lambda (url)
+ (quri:copy-uri url :host "old.reddit.com"))))
+
+(defvar *my-request-resource-handlers* (list old-reddit-handler))
+
+(define-configuration buffer
+ ((request-resource-hook
+ (reduce #'hooks:add-hook
+ *my-request-resource-handlers*
+ :initial-value %slot-default%))))
+
diff --git a/tmp/drgn.nyxt/base/glyphs.lisp b/home/user/.config/nyxt/base/glyphs.lisp
index cc85881..00a3d9d 100644
--- a/tmp/drgn.nyxt/base/glyphs.lisp
+++ b/home/user/.config/nyxt/base/glyphs.lisp
@@ -13,9 +13,9 @@
(define-configuration nyxt/style-mode:style-mode ((glyph "s")))
(define-configuration nyxt/help-mode:help-mode ((glyph "?")))
-;;configure web mode hints to home row fore colemak and set glyph
+;;configure web mode hints to home row and set glyph
(define-configuration nyxt/web-mode:web-mode
- ((nyxt/web-mode:hints-alphabet "ARSTGMNEIO")
+ ((nyxt/web-mode:hints-alphabet "ASDFGHJKL")
(glyph "ω")))
;;auto-mode config and set glyph
diff --git a/tmp/drgn.nyxt/base/keybindings.lisp b/home/user/.config/nyxt/base/keybindings.lisp
index 84f0cef..1a7758e 100644
--- a/tmp/drgn.nyxt/base/keybindings.lisp
+++ b/home/user/.config/nyxt/base/keybindings.lisp
@@ -4,12 +4,12 @@
(define-configuration buffer
((override-map (let ((map (make-keymap "my-override-map")))
(define-key map
- "M-i" 'show-weather
- "C-t" 'set-url-new-buffer
- "C-2" 'open-external-browser
- "C-0" 'no-mercy
- "M-x" 'execute-command
- "C-s" 'query-selection-in-search-engine
- "C-c" 'nyxt/web-mode::copy ;;currently an override because C-c not working without it
- "C-q" 'quit-history)
+ "M-i" 'show-weather
+ "M-x" 'execute-command
+ "C-o" 'query-selection-in-search-engine
+ "C-c" 'nyxt/web-mode::copy ;;currently an override because C-c not working without it
+ "C-q" 'quit-history
+ "C-t" 'toggle-toolbars
+ "C-e" 'edit-with-external-editor
+ "C-x" 'edit-user-file-with-external-editor)
map))))
diff --git a/tmp/drgn.nyxt/base/urlprompt.lisp b/home/user/.config/nyxt/base/urlprompt.lisp
index bb7f0c1..7a34742 100644
--- a/tmp/drgn.nyxt/base/urlprompt.lisp
+++ b/home/user/.config/nyxt/base/urlprompt.lisp
@@ -4,10 +4,11 @@
;;order: "shortcut" "url for search, ~a determines where query is placed" "fallback url when query fails or an empty search"
(defvar *my-search-engines*
(list
- '("az" "https://amazon.com/s?k=~a" "https://amazon.com/") ;;amazon
+ '("az" "https://amazon.fr/s?k=~a" "https://amazon.fr/") ;;amazon
'("hns" "https://hns.to/~a" "https://hns.to/") ;;handshake addresses
- '("git" "https://github.com/search?q=~a" "https://github.com/") ;;git repos
+ '("gh" "https://github.com/search?q=~a" "https://github.com/") ;;git repos
'("wiki" "https://en.wikipedia.org/w/index.php?search=~a" "https://en.wikipedia.org/") ;;wikipedia
+ '("sp" "https://www.startpage.com/do/dsearch?query=~a" "https://www.startpage.com/") ;;startpage
'("ddg" "https://duckduckgo.com/?q=~a" "https://duckduckgo.com/") ;;duckduckgo
(define-configuration buffer
diff --git a/home/user/.config/nyxt/ex/bookmarklets.lisp b/home/user/.config/nyxt/ex/bookmarklets.lisp
new file mode 100644
index 0000000..3ee036c
--- /dev/null
+++ b/home/user/.config/nyxt/ex/bookmarklets.lisp
@@ -0,0 +1,3 @@
+(define-bookmarklet-command mouse-over-image-preview
+ "Description"
+ "insert JS here")
diff --git a/tmp/drgn.nyxt/ex/specificurl.lisp b/home/user/.config/nyxt/ex/specificurl.lisp
index 25443c6..21cb4d4 100644
--- a/tmp/drgn.nyxt/ex/specificurl.lisp
+++ b/home/user/.config/nyxt/ex/specificurl.lisp
@@ -2,6 +2,22 @@
;;extra .lisp file for the configs of various search engines/url prompts to get straight to them via command/binding
+;;command to start running a search from sp directly
+(define-command-global search-sp (&key (prefill-current-url-p t))
+ "Set sp in the url prompt to search straight from startpage."
+ (let ((actions (list (make-command buffer-load* (suggestion-values)
+ "Load first selected URL in current buffer and the rest in new buffer(s)."
+ (mapc (lambda (suggestion) (make-buffer :url (url suggestion))) (rest suggestion-values))
+ (buffer-load (url (first suggestion-values))))
+ (make-command new-buffer-load (suggestion-values)
+ "Load URL(s) in new buffer(s)."
+ (mapc (lambda (suggestion) (make-buffer :url (url suggestion))) (rest suggestion-values))
+ (make-buffer-focus :url (url (first suggestion-values)))))))
+ (prompt
+ :prompt "Startpage"
+ :input "sp "
+ :sources (list (make-instance 'user-new-url-or-search-source :actions actions)))))
+
;;command to start running a search from ddg directly
(define-command-global search-ddg (&key (prefill-current-url-p t))
"Set ddg in the url prompt to search straight from duckduckgo."
@@ -18,9 +34,9 @@
:input "ddg "
:sources (list (make-instance 'user-new-url-or-search-source :actions actions)))))
- ;;command to start running a search from git directly
-(define-command-global search-git (&key (prefill-current-url-p t))
- "Set git in the url prompt to search straight from github."
+ ;;command to start running a search from gh directly
+(define-command-global search-gh (&key (prefill-current-url-p t))
+ "Set gh in the url prompt to search straight from github."
(let ((actions (list (make-command buffer-load* (suggestion-values)
"Load first selected URL in current buffer and the rest in new buffer(s)."
(mapc (lambda (suggestion) (make-buffer :url (url suggestion))) (rest suggestion-values))
@@ -31,7 +47,7 @@
(make-buffer-focus :url (url (first suggestion-values)))))))
(prompt
:prompt "GitHub"
- :input "git "
+ :input "gh "
:sources (list (make-instance 'user-new-url-or-search-source :actions actions)))))
;;command to start running a search from wiki directly
diff --git a/home/user/.config/nyxt/icon.png b/home/user/.config/nyxt/icon.png
new file mode 100644
index 0000000..e962ff5
Binary files /dev/null and b/home/user/.config/nyxt/icon.png differ
diff --git a/tmp/drgn.nyxt/init.lisp b/home/user/.config/nyxt/init.lisp
index 526762c..7e8e6de 100644
--- a/tmp/drgn.nyxt/init.lisp
+++ b/home/user/.config/nyxt/init.lisp
@@ -2,31 +2,28 @@
;;loading of config files
;;add theme here
-(nyxt::load-lisp "~/.config/nyxt/themes/standard-dark.lisp")
+(nyxt::load-lisp "~/.config/nyxt/themes/kabouik-standard-dark.lisp")
;;base
(nyxt::load-lisp "~/.config/nyxt/base/keybindings.lisp")
(nyxt::load-lisp "~/.config/nyxt/base/urlprompt.lisp")
(nyxt::load-lisp "~/.config/nyxt/base/commands.lisp")
(nyxt::load-lisp "~/.config/nyxt/base/glyphs.lisp")
+(nyxt::load-lisp "~/.config/nyxt/base/domainrules.lisp")
;;extending
(nyxt::load-lisp "~/.config/nyxt/ex/specificurl.lisp")
+(nyxt::load-lisp "~/.config/nyxt/ex/bookmarklets.lisp")
;;configuration for browser
(define-configuration browser
- ((session-restore-prompt :never-restore)))
+ ((session-restore-prompt :always-ask)))
;;configuration for buffer and nosave buffer to have reduce tracking by default
(define-configuration (web-buffer nosave-buffer)
- ((default-modes `(reduce-tracking-mode
+ ((default-modes `(reduce-tracking-mode blocker-mode
,@%slot-default%))))
-;;setting new buffer url and having nyxt start full screen
-(defmethod nyxt::startup ((browser browser) urls)
- "Home"
- (window-make browser)
- (let ((window (current-window)))
- (window-set-buffer window (make-buffer :url (quri:uri "https://nyxt.atlas.engineer/")))
- (toggle-fullscreen window)))
+;;disable smooth-scrolling
+(define-configuration buffer ((smooth-scrolling nil)))
;;when reloading init.lisp file shows in message bar once finished
(echo "Loaded config.")
diff --git a/tmp/drgn.nyxt/scripts/shutdown.sh b/tmp/drgn.nyxt/scripts/shutdown.sh
deleted file mode 100644
index 4cf3d42..0000000
--- a/tmp/drgn.nyxt/scripts/shutdown.sh
+++ /dev/null
@@ -1 +0,0 @@
-shutdown -h now
diff --git a/tmp/drgn.nyxt/scripts/spotify.sh b/tmp/drgn.nyxt/scripts/spotify.sh
deleted file mode 100644
index 548aaf0..0000000
--- a/tmp/drgn.nyxt/scripts/spotify.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-xdotool search --classname spotify windowkill %@ &
-
-sleep 2s
-
-/usr/share/spotify/spotify &
-'''
-sleep 10s
-
-xdotool search --classname spotify set_desktop_for_window %@ 0 &
-
-
-
-
diff --git a/tmp/drgn.nyxt/scripts/weather.sh b/home/user/.config/nyxt/scripts/weather.sh
old mode 100644
new mode 100755
diff --git a/home/user/.config/nyxt/themes/kabouik-standard-dark.lisp b/home/user/.config/nyxt/themes/kabouik-standard-dark.lisp
new file mode 100644
index 0000000..e2901a2
--- /dev/null
+++ b/home/user/.config/nyxt/themes/kabouik-standard-dark.lisp
@@ -0,0 +1,139 @@
+(in-package #:nyxt-user)
+
+;;configuration window
+(define-configuration window
+ ((message-buffer-style
+ (str:concat
+ %slot-default%
+ (cl-css:css
+ '((body
+ :background-color "#292d3e"
+ :color "#bfc7e5")))))))
+
+;prompt buffer
+(define-configuration prompt-buffer
+ ((style (str:concat
+ %slot-default%
+ (cl-css:css
+ '((*
+ :font-family "monospace,monospace"
+ :font-size "12px"
+ :line-height "12px")
+ (body
+ :background-color "#292d3e"
+ :color "#bfc7e5")
+ ("#vi-mode"
+ :line-height "18px")
+ ("#prompt-area"
+ :background-color "#292d3e")
+ ("#prompt-area-vi"
+ :background-color "#292d3e")
+ ("#input"
+ :background-color "#3D425A"
+ :color "#cccccc")
+ (".source-name"
+ :background-color "#141724"
+ :color "#cccccc")
+ (".source-content"
+ :width "100%"
+ :background-color "#292d3e")
+ (".source-content th"
+ :background-color "292d3e"
+ :font-weight "bold")
+ (".source-content th:nth-child(1)"
+ :width "20%")
+ (".source-content th:nth-child(2)"
+ :width "9%")
+ (".source-content th:nth-child(3)"
+ :width "54%")
+ (".source-content th:nth-child(4)"
+ :width "17%")
+ ("#selection"
+ :background-color "#141724")
+ (.marked :background-color "black"
+ :font-weight "bold"
+ :color "#cccccc")
+ (.selected :background-color "black"
+ :color "#cccccc")))))))
+
+;internal buffer
+(define-configuration internal-buffer
+ ((style
+ (str:concat
+ %slot-default%
+ (cl-css:css
+ '((title
+ :color "#bfc7e5")
+ (body
+ :background-color "#292d3e"
+ :color "#bfc7e5")
+ (hr
+ :color "#bfc7e5")
+ (a
+ :color "#bfc7e5")
+ (.button
+ :color "#292d3e"
+ :background-color "#bfc7e5")))))))
+
+;;history tree
+(define-configuration nyxt/history-tree-mode:history-tree-mode
+ ((nyxt/history-tree-mode::style
+ (str:concat
+ %slot-default%
+ (cl-css:css
+ '((body
+ :background-color "#292d3e"
+ :color "#bfc7e5")
+ (hr
+ :color "#3d425a")
+ (a
+ :color "#bfc7e5")
+ ("ul li::before"
+ :background-color "#bfc7e5")
+ ("ul li::after"
+ :background-color "#bfc7e5")
+ ("ul li:only-child::before"
+ :background-color "#bfc7e5")))))))
+
+;;highlight boxes
+(define-configuration nyxt/web-mode:web-mode
+ ((nyxt/web-mode:highlighted-box-style
+ (cl-css:css
+ '((".nyxt-hint.nyxt-highlight-hint"
+ :background "#292d3e")))
+ :documentation "The style of highlighted boxes, e.g. link hints.")))
+
+;;styling status buffer black and setting size of tabs and modes. Can uncomment url and controls section for theming those.
+(define-configuration status-buffer
+ ((style (str:concat
+ %slot-default%
+ (cl-css:css
+ '((*
+ :font-family "monospace,monospace")
+ ("#controls"
+ :background-color "#292d3e"
+ :border-top "1px solid black")
+ ("#url"
+ :background-color "#292d3e"
+ :border-top "1px solid black"
+ :font-size "11px")
+ ("#modes"
+ :background-color "#292d3e"
+ :border-top "1px solid black"
+ :font-size "11px")
+ ("#tabs"
+ :background-color "#292d3e"
+ :color "#bfc7e5"
+ :font-size "11px"
+ :border-top "1px solid black")
+ (".controls:hover"
+ :color "#bfc7e5")
+ (".modes:hover"
+ :color "#bfc7e5")
+ (".button:hover"
+ :color "#bfc7e5")
+ (".url:hover"
+ :color "#bfc7e5")
+ (".tab:hover"
+ :color "#bfc7e5")))))))
+
Mostly changes on the dark theme. Still other things I would like to implement (e.g., the list in my previous post, but there are others things on my list). The search engines set in base/urlprompt.lisp
also don’t seem to work for me, they always just end in Duckduckgo instead of searching directly on corresponding sits, But I think they are a bit redundant with Duckduckgo !bang commands anyway so I might remove them eventually and just use !bang like !imdb, !sp, !gi, as those won’t need any Nyxt config. Maybe I just didn’t understand how to use them.