aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Ángel Moreno <mail@migalmoreno.com>2024-06-30 09:45:09 +0200
committerMiguel Ángel Moreno <mail@migalmoreno.com>2024-06-30 09:45:09 +0200
commitc9c9e53a34ae1935ff315dfe9bab72bd2e5c800b (patch)
treeb0ef7665211bddf572a55e1984bc4f367205bd12
parentd519df09b4e5f79c745573eef90f2f7a28157b56 (diff)
feat: allow passing a tailor:user-theme object to nyxt-load-theme
-rw-r--r--nyxt.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/nyxt.el b/nyxt.el
index 858a6db..01b5a1c 100644
--- a/nyxt.el
+++ b/nyxt.el
@@ -221,7 +221,9 @@ Optionally test if the extension's SYMBOL is bound."
;;;###autoload
(defun nyxt-load-theme (theme)
- "Load THEME in Nyxt."
+ "Load THEME in Nyxt.
+THEME can be the name of one of the currently loaded `tailor:user-theme' themes
+or a new quoted `tailor:user-theme' instance."
(interactive
(list
(intern
@@ -235,7 +237,9 @@ Optionally test if the extension's SYMBOL is bound."
'(mapcar #'tailor::name
(tailor:themes (tailor::current-tailor-mode))))))))))
(if (nyxt--extension-p "nx-tailor" "load-theme")
- (nyxt-run `(nx-tailor:load-theme ',theme))
+ (nyxt-run (if (listp theme)
+ `(nx-tailor:load-theme ,theme)
+ `(nx-tailor:load-theme ',theme)))
(error "You need the nx-tailor extension to change Nyxt theme")))
;;;###autoload