mirror of
https://github.com/danth/stylix
synced 2025-02-27 20:57:13 +00:00
Update README 📝
Details about recent changes, and some miscellaneous edits.
This commit is contained in:
parent
0f32bd147a
commit
283e463051
1 changed files with 35 additions and 33 deletions
68
README.md
68
README.md
|
@ -1,15 +1,13 @@
|
||||||
# Stylix
|
# Stylix
|
||||||
|
|
||||||
Stylix is a NixOS module which applies the same color scheme, font and
|
Stylix is a NixOS module which applies the same color scheme, font and
|
||||||
wallpaper to a wide range of applications and desktop environments.
|
wallpaper to a wide range of applications and desktop environments. It also
|
||||||
In some cases, theming can be activated as early as the bootloader!
|
exports utilities for you to use the theme in custom parts of your configuration.
|
||||||
|
|
||||||
It also exports utilities for you to apply the theming to custom parts of your
|
|
||||||
configuration.
|
|
||||||
|
|
||||||
Stylix is built using [base16.nix](https://github.com/SenchoPens/base16.nix#readme),
|
Stylix is built using [base16.nix](https://github.com/SenchoPens/base16.nix#readme),
|
||||||
a library which handles the generation of config files from templates provided by
|
a library which processes themes created for
|
||||||
the [base16](https://github.com/chriskempson/base16#readme) project.
|
[base16](https://github.com/chriskempson/base16#readme) or
|
||||||
|
[Tinted Theming](https://github.com/tinted-theming).
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
@ -65,34 +63,36 @@ stylix.image = pkgs.fetchurl {
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
The wallpaper is the only option which is required! On home-manager used from a NixOS
|
At this point you should be able to rebuild and have a reasonable theme
|
||||||
configuration, the system image will be used by default, thus nothing is required at
|
generated based on the image you chose.
|
||||||
all.
|
|
||||||
|
|
||||||
## Color scheme
|
## Color scheme
|
||||||
|
|
||||||
### Automatic color schemes
|
### Automatic color schemes
|
||||||
|
|
||||||
If you only set a wallpaper, Stylix will use a
|
If you only set a wallpaper, Stylix will use a [genetic
|
||||||
[genetic algorithm](https://en.wikipedia.org/wiki/Genetic_algorithm)
|
algorithm](https://en.wikipedia.org/wiki/Genetic_algorithm) to generate a color
|
||||||
to choose a color scheme based on it. The quality of these automatically
|
scheme. The quality of these automatically generated schemes can vary, but more
|
||||||
generated schemes can vary, but more colorful images tend to have better
|
colorful images tend to have better results.
|
||||||
results.
|
|
||||||
|
|
||||||
You can force a light or dark theme using the polarity option:
|
You can force the generation of a light or dark theme using the polarity
|
||||||
|
option:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
stylix.polarity = "dark";
|
stylix.polarity = "dark";
|
||||||
```
|
```
|
||||||
|
|
||||||
The generated scheme can be viewed in a web browser at
|
After rebuilding, the full theme can be previewed at
|
||||||
`file:///etc/stylix/palette.html`.
|
`file:///etc/stylix/palette.html` in a web browser.
|
||||||
|
|
||||||
### Manual color schemes
|
### Manual color schemes
|
||||||
|
|
||||||
Alternatively, you can choose a pre-made colorscheme from
|
If you would prefer to choose a theme, you can use anything from
|
||||||
[the Tinted Theming repository](https://github.com/tinted-theming/base16-schemes).
|
[the Tinted Theming repository](https://github.com/tinted-theming/base16-schemes),
|
||||||
Either add the repository to your Flake inputs, or fetch it as follows:
|
or another file following that format.
|
||||||
|
|
||||||
|
To use Tinted Theming, either add their repository to your Flake inputs, or
|
||||||
|
fetch it as follows:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
let base16-schemes = pkgs.fetchFromGitHub {
|
let base16-schemes = pkgs.fetchFromGitHub {
|
||||||
|
@ -103,21 +103,14 @@ let base16-schemes = pkgs.fetchFromGitHub {
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
Then you can choose which file you would like to use:
|
Then set the following option to the path of the theme you would like to use:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
stylix.base16Scheme = "${base16-schemes}/gruvbox-dark-hard.yaml";
|
stylix.base16Scheme = "${base16-schemes}/gruvbox-dark-hard.yaml";
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want to do anything more complex - such as running your own program to
|
`base16Scheme` can also accept other formats as supported by
|
||||||
generate the colour scheme - `base16Scheme` can accept any argument which
|
[`mkSchemeAttrs`](https://github.com/SenchoPens/base16.nix/blob/main/DOCUMENTATION.md#mkschemeattrs).
|
||||||
[`mkSchemeAttrs`](https://github.com/SenchoPens/base16.nix/blob/main/DOCUMENTATION.md#mkschemeattrs)
|
|
||||||
supports.
|
|
||||||
|
|
||||||
If the system `base16Scheme` is set this way, it will be used as default for the
|
|
||||||
corresponding `home-manager` option only if the user config has the same image. If
|
|
||||||
the user has changed the image, the default value will be the generated color scheme
|
|
||||||
from this picture.
|
|
||||||
|
|
||||||
## Fonts
|
## Fonts
|
||||||
|
|
||||||
|
@ -149,13 +142,14 @@ stylix.fonts = {
|
||||||
|
|
||||||
These can be changed as you like.
|
These can be changed as you like.
|
||||||
|
|
||||||
To make things more uniform, you can replace the serif font with sans-serif:
|
To make things look more uniform, you could replace the serif font with
|
||||||
|
the sans-serif font:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
stylix.fonts.serif = config.stylix.fonts.sansSerif;
|
stylix.fonts.serif = config.stylix.fonts.sansSerif;
|
||||||
```
|
```
|
||||||
|
|
||||||
Or even use monospace for everything:
|
Or even choose monospace for everything:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
stylix.fonts = {
|
stylix.fonts = {
|
||||||
|
@ -180,6 +174,14 @@ If you would like to disable all Home Manager activity for a user, you can set
|
||||||
`stylix.homeManagerIntegration.autoImport = false`, then manually import the
|
`stylix.homeManagerIntegration.autoImport = false`, then manually import the
|
||||||
Home Manager module for the users for which it should be enabled.
|
Home Manager module for the users for which it should be enabled.
|
||||||
|
|
||||||
|
Note that if the wallpaper image for a user is different to the rest of the
|
||||||
|
system, a separate theme will always be generated for them, even though their
|
||||||
|
`base16Scheme` option has not been overridden. If you want that user to follow
|
||||||
|
the system theme while having a different wallpaper, you will need to manually
|
||||||
|
copy the system theme into their configuration. (This behaviour is necessary as
|
||||||
|
otherwise it would be impossible to use a generated theme for a user while
|
||||||
|
having a manually created theme for the rest of the system.)
|
||||||
|
|
||||||
## Turning targets on and off
|
## Turning targets on and off
|
||||||
|
|
||||||
In Stylix terms, a target is anything which can have colors, fonts or a
|
In Stylix terms, a target is anything which can have colors, fonts or a
|
||||||
|
|
Loading…
Add table
Reference in a new issue