diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2023-06-12 16:58:02 +0200 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2023-06-12 17:03:26 +0200 |
commit | b6448bedbfc93868aed016bc4130fcee74cd212d (patch) | |
tree | 3fadcd8ef55fb70f09f8c202310378da22473a39 | |
parent | 312f34e1ed8319a96c56813cdc0547d39ec64300 (diff) |
doc: Update with latest changes
-rw-r--r-- | README | 50 | ||||
-rw-r--r-- | README.md | 50 |
2 files changed, 52 insertions, 48 deletions
@@ -1,13 +1,13 @@ # -*- mode: org; org-html-head-include-default-style: nil; org-html-postamble: nil; -*- #+OPTIONS: toc:nil num:nil * nx-tailor -=nx-tailor= is a thin wrapper over the [[https://nyxt.atlas.engineer/][Nyxt]] built-in theme library (=nyxt/theme=). Its main purpose is to allow handling multiple themes inside a single browser session (useful for night/day theme switching) and to streamline theme selection on startup based on user configuration. +=nx-tailor= is a thin wrapper over the [[https://nyxt.atlas.engineer/][Nyxt]] built-in theme library (=nyxt/theme=). Its main purpose is to allow handling multiple themes inside a single browser session and to streamline theme selection on startup based on user configuration. ** 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=). #+begin_src sh -git clone https://git.sr.ht/~conses/nx-tailor ~/.local/share/nyxt/extensions/nx-tailor +git clone https://git.mianmoreno.com/nx-tailor ~/.local/share/nyxt/extensions/nx-tailor #+end_src The extension works with *Nyxt 3 onward* but it's encouraged to use it with the latest version of Nyxt master for the time being. It also requires you to use the [[https://www.sbcl.org/manual/][SBCL]] Common Lisp implementation to make use of the scheduling capabilities for automatic theme switching. @@ -49,7 +49,7 @@ To ensure automatic theme switching works accurately both at startup and through #+end_src ** Configuration -As mentioned, =nx-tailor= is just a layer above the =nyxt/theme= library, which is why its configuration is quite minimal. +To set up =nx-tailor=, you can write a configuration like this: #+begin_src lisp (define-configuration tailor:tailor-mode @@ -59,25 +59,27 @@ As mentioned, =nx-tailor= is just a layer above the =nyxt/theme= library, which (tailor:main '(modus-operandi . modus-vivendi)) (tailor:themes (list - (make-theme 'modus-operandi - :background-color "white" - :on-background-color "black" - :primary-color "#093060" - :secondary-color "#dfdfdf" - :on-secondary-color "#f0f0f0" - :accent-color "#8f0075" - :on-accent-color "#005a5f" - :font-family "Iosevka") - (make-theme 'modus-vivendi - :dark-p t - :background-color "black" - :on-background-color "white" - :primary-color "#c6eaff" - :secondary-color "#323232" - :on-secondary-color "#a8a8a8" - :accent-color "#afafef" - :on-accent-color "#a8a8a8" - :font-family "Iosevka"))))) + (make-instance 'tailor:user-theme + :name 'modus-operandi + :background-color "white" + :on-background-color "black" + :primary-color "#093060" + :secondary-color "#dfdfdf" + :on-secondary-color "#f0f0f0" + :accent-color "#8f0075" + :on-accent-color "#005a5f" + :font-family "Iosevka") + (make-instance 'tailor:user-theme + :name 'modus-vivendi + :dark-p t + :background-color "black" + :on-background-color "white" + :primary-color "#c6eaff" + :secondary-color "#323232" + :on-secondary-color "#a8a8a8" + :accent-color "#afafef" + :on-accent-color "#a8a8a8" + :font-family "Iosevka"))))) #+end_src Where =tailor:tailor-mode= slots include: @@ -85,8 +87,8 @@ 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 when 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 when the dark theme should be applied. -- =main= :: if =auto-p= is =nil=, this takes a symbol with the theme ID to be selected at browser startup. Otherwise, it can take a cons pair of the form =(LIGHT-THEME . DARK-THEME)= for the corresponding light/dark theme IDs to be picked from the =themes= list 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 =theme:theme= themes, each consisting of a mandatory symbol ID and the set of theme attributes as per the =theme:theme= constructor. +- =main= :: if =auto-p= is =nil=, this takes a symbol with the theme name to be selected at 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 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 =user-theme= themes, each consisting of a mandatory symbol name and the set of theme attributes as per the =theme:theme= constructor. That's all you need for the extension to work. To see it take effect, simply invoke the =load-theme= command and you'll see the theme change on the fly. @@ -2,14 +2,14 @@ # nx-tailor -`nx-tailor` is a thin wrapper over the [Nyxt](https://nyxt.atlas.engineer/) built-in theme library (`nyxt/theme`). Its main purpose is to allow handling multiple themes inside a single browser session (useful for night/day theme switching) and to streamline theme selection on startup based on user configuration. +`nx-tailor` is a thin wrapper over the [Nyxt](https://nyxt.atlas.engineer/) built-in theme library (`nyxt/theme`). Its main purpose is to allow handling multiple themes inside a single browser session and to streamline theme selection on startup based on user configuration. ## 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`). - git clone https://git.sr.ht/~conses/nx-tailor ~/.local/share/nyxt/extensions/nx-tailor + git clone https://git.mianmoreno.com/nx-tailor ~/.local/share/nyxt/extensions/nx-tailor The extension works with **Nyxt 3 onward** but it's encouraged to use it with the latest version of Nyxt master for the time being. It also requires you to use the [SBCL](https://www.sbcl.org/manual/) Common Lisp implementation to make use of the scheduling capabilities for automatic theme switching. @@ -43,7 +43,7 @@ To ensure automatic theme switching works accurately both at startup and through ## Configuration -As mentioned, `nx-tailor` is just a layer above the `nyxt/theme` library, which is why its configuration is quite minimal. +To set up `nx-tailor`, you can write a configuration like this: (define-configuration tailor:tailor-mode ((tailor:auto-p :time) @@ -52,33 +52,35 @@ As mentioned, `nx-tailor` is just a layer above the `nyxt/theme` library, which (tailor:main '(modus-operandi . modus-vivendi)) (tailor:themes (list - (make-theme 'modus-operandi - :background-color "white" - :on-background-color "black" - :primary-color "#093060" - :secondary-color "#dfdfdf" - :on-secondary-color "#f0f0f0" - :accent-color "#8f0075" - :on-accent-color "#005a5f" - :font-family "Iosevka") - (make-theme 'modus-vivendi - :dark-p t - :background-color "black" - :on-background-color "white" - :primary-color "#c6eaff" - :secondary-color "#323232" - :on-secondary-color "#a8a8a8" - :accent-color "#afafef" - :on-accent-color "#a8a8a8" - :font-family "Iosevka"))))) + (make-instance 'tailor:user-theme + :name 'modus-operandi + :background-color "white" + :on-background-color "black" + :primary-color "#093060" + :secondary-color "#dfdfdf" + :on-secondary-color "#f0f0f0" + :accent-color "#8f0075" + :on-accent-color "#005a5f" + :font-family "Iosevka") + (make-instance 'tailor:user-theme + :name 'modus-vivendi + :dark-p t + :background-color "black" + :on-background-color "white" + :primary-color "#c6eaff" + :secondary-color "#323232" + :on-secondary-color "#a8a8a8" + :accent-color "#afafef" + :on-accent-color "#a8a8a8" + :font-family "Iosevka"))))) 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 when 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 when the dark theme should be applied. -- **`main`:** if `auto-p` is `nil`, this takes a symbol with the theme ID to be selected at browser startup. Otherwise, it can take a cons pair of the form `(LIGHT-THEME . DARK-THEME)` for the corresponding light/dark theme IDs to be picked from the `themes` list 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 `theme:theme` themes, each consisting of a mandatory symbol ID and the set of theme attributes as per the `theme:theme` constructor. +- **`main`:** if `auto-p` is `nil`, this takes a symbol with the theme name to be selected at 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 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 `user-theme` themes, each consisting of a mandatory symbol name and the set of theme attributes as per the `theme:theme` constructor. That's all you need for the extension to work. To see it take effect, simply invoke the `load-theme` command and you'll see the theme change on the fly. |