aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Ángel Moreno <mail@migalmoreno.com>2022-07-10 14:13:37 +0200
committerMiguel Ángel Moreno <mail@migalmoreno.com>2022-07-10 14:13:37 +0200
commit34d186b5c411c6db6a4d6dcfee652f7a71637a51 (patch)
tree6632e254fc882b0e840a3ab3c41b630d975fc6c3
parent81bb536a6206d5ee71cf3bfb8ac3e0e9d751741e (diff)
chore: Updates documentation with additions
-rw-r--r--README30
1 files changed, 25 insertions, 5 deletions
diff --git a/README b/README
index ab87982..891c104 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
# -*- mode: org; -*-
#+title: nx-tailor
-=nx-tailor= is a tailor for all-things [[https://nyxt.atlas.engineer/][Nyxt]] themes which helps you manage them, change them on-the-fly, and discover new ones in a unified interface. It provides high customizability over the smallest bits on Nyxt's interface, for those that enjoy their browser to match their style.
+=nx-tailor= is an interface to manage [[https://nyxt.atlas.engineer/][Nyxt]] built-in themes. It provides handy features such as allowing users to change the current browser theme on-the-fly or automatically apply them based on system settings or on the time of the day. It offers high customization over the smallest bits of Nyxt's interface, for those that enjoy their browser to match their style.
* Installation
To install the extension, you should download the source and place it in Nyxt's extensions path, given by the value of =nyxt-source-registry= (by default =~/.local/share/nyxt/extensions=).
@@ -34,13 +34,16 @@ In your Nyxt initialization file, place the following.
Where =/path/to/tailor.lisp= is a custom file that should be created to provide the extension settings after the =nx-tailor= system has been successfully loaded. Inside this file, you should provide the extension options, explained in the following section.
* Configuration
-=nx-tailor='s configuration is very simple and it involves passing in a list of themes to apply to the browser.
+=nx-tailor='s configuration is straightforward, as shown in the following example:
#+begin_src lisp
(import 'nx-tailor:make-theme)
(define-configuration tailor:tailor-mode
- ((tailor:auto-p t) ; Set theme based on GTK_THEME
+ ((tailor:auto-p :time)
+ (tailor:light-theme-threshold (* 8 60 60))
+ (tailor:dark-theme-threshold (* 21.5 60 60))
+ (tailor:main '("Modus Operandi" . "Dracula"))
(tailor:themes
(list
(make-theme "Modus Operandi"
@@ -63,10 +66,27 @@ Where =/path/to/tailor.lisp= is a custom file that should be created to provide
:accent-color "#afafef"
:on-accent-color "#a8a8a8"
:font-family "Iosevka"
+ :cut (make-instance 'tailor:cut))
+ (make-theme "Dracula"
+ :dark-p t
+ :background-color "#282a36"
+ :on-background-color "#f8f8f2"
+ :primary-color "#bd93f9"
+ :secondary-color "#6272a4"
+ :on-secondary-color "#f8f8f2"
+ :accent-color "#8be9fd"
+ :on-accent-color "#282a36"
+ :font-family "Iosevka"
:cut (make-instance 'tailor:cut))))))
#+end_src
-Above, we define some themes with a name and a set of theme attributes from the built-in =nyxt/theme= library. Optionally, each internal theme can take a =cut=, a list of CSS rules for various UI elements to give the browser a more custom look and allowing dynamic theme change without having to restart the browser, useful if you're the kind of person who switches between light and dark themes depending on the time of the day. A =cut= effectively aims at simplifying themeing, which is normally achieved by having to look through the =style= slot of multiple classes.
+Where =tailor:tailor-mode= slots include:
+
+- =auto-p= (default: =nil=) :: if =:time= or =t=, it will set the theme based on the time of the day. If =:gtk=, it will apply it based on the current GTK theme (specifically, it will check the =GTK_THEME= variable).
+- =light-theme-threshold= (default: =(* 6 60 60)=) :: if =auto-p= is set to =:time= or =t=, this indicates the number of seconds after midnight at which the light theme should be applied.
+- =dark-theme-threshold= (default: =(* 21 60 60)=) :: if =auto-p= is set to =:time= or =t=, this indicates the number of seconds after midnight at which the dark theme should be applied.
+- =main= :: if =auto-p= is =nil=, this takes a string with the theme name to be selected on browser startup. Otherwise, it can take a cons pair of the form =(LIGHT-THEME . DARK-THEME)= for the corresponding light/dark theme names to be picked from the =themes= list of themes when applying =auto-p= logic. If no =main= is supplied, the first non-=:dark-p= theme from =themes= will be chosen as the light theme and the first =:dark-p= theme from =themes= as the dark theme.
+- =themes= :: a list of themes, with each consisting of a mandatory name, a set of theme attributes from the built-in =nyxt/theme= library and a =:cut=, an object with that can take lists of CSS rules as its slots for many of Nyxt's interface elements. A =cut= effectively aims at simplifying themeing, which is normally achieved by having to look through the =style= slot of multiple classes.
#+begin_src lisp
(import 'tailor:make-important)
@@ -198,7 +218,7 @@ Above, we define some themes with a name and a set of theme attributes from the
The above is an example =cut= which I use in my configuration to achieve a more compact look to Nyxt. However, you're free to modify or not each slot to your heart's content. You can pass different =cut='s to different themes, allowing you to change both the color palette and the layout of Nyxt per theme.
-After having defined your themes, you can alternate between them with the =select-theme= command.
+After having defined your =themes=, you can quickly choose between them with the =select-theme= command.
[[file:assets/cut-operandi.png]]