Add FAQ.md (#52)

Co-authored-by: Daniel Thwaites <danthwaites30@btinternet.com>
This commit is contained in:
SnIcK 2023-03-02 03:49:44 -06:00 committed by GitHub
parent e7066a9ffb
commit dd7fc590c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 27 deletions

24
FAQ.md Normal file
View file

@ -0,0 +1,24 @@
# FAQ
## NixOS Stylix Tricks
### Adjusting the brightness and contrast of a background image
If you want to use a background image for your desktop but find it too bright or distracting, you can use the `imagemagick` package to dim the image, or adjust its brightness and contrast to suit your preference.
Here's an example Nix expression that takes an input image, applies a brightness/contrast adjustment to it, and saves the result as a new image file:
```nix
{ pkgs, ... }:
let
inputImage = ./path/to/image.jpg;
brightness = -30;
contrast = 0;
fillColor = "black"
in
{
stylix.image = pkgs.runCommand "dimmed-background.png" { } ''
${pkgs.imagemagick}/bin/convert "${inputImage}" -brightness-contrast ${brightness},${contrast} -fill ${fillColor} $out
'';
}

View file

@ -1,31 +1,19 @@
{ pkgs, pkgsLib, coricamuLib, inputs, ... }:
{ pkgs, pkgsLib, coricamuLib, config, inputs, ... }:
{
with coricamuLib;
rec {
baseUrl = "https://danth.github.io/stylix/";
siteTitle = "Stylix";
language = "en-gb";
header.html = ''
<h1>Stylix</h1>
<nav>
<a href="">Home</a>
<a href="options.html">NixOS options</a>
<a href="options-hm.html">Home Manager options</a>
<a href="https://github.com/danth/stylix">GitHub repository</a>
</nav>
'';
pages = [
{
path = "index.html";
title = "Stylix";
body.markdownFile = pkgs.runCommand "index.md" {} ''
# Remove the title line
tail -n+2 ${../README.md} >$out
'';
}
header = makeProjectHeader {
title = siteTitle;
inherit (config) pages;
repository = "https://github.com/danth/stylix";
};
pages = makeProjectPages ../. ++ [
{
path = "options.html";
title = "NixOS options";
@ -42,7 +30,7 @@
};
in
builtins.readFile ./nixos_header.xml +
coricamuLib.makeOptionsDocBook {
makeOptionsDocBook {
inherit (configuration) options;
customFilter = option: builtins.elemAt option.loc 0 == "stylix";
};
@ -71,7 +59,7 @@
};
in
builtins.readFile ./hm_header.xml +
coricamuLib.makeOptionsDocBook {
makeOptionsDocBook {
inherit (configuration) options;
customFilter = option: builtins.elemAt option.loc 0 == "stylix";
};

View file

@ -28,11 +28,11 @@
"utils": "utils"
},
"locked": {
"lastModified": 1659649195,
"narHash": "sha256-wRpMO4Mm4uizR5M71iipdi8ssSYMEPPAIwWyFYnhnco=",
"lastModified": 1677749800,
"narHash": "sha256-xIqxDr4fkOA5R4OudbQoUMS8xvPJNCyGfqugENutSP4=",
"owner": "danth",
"repo": "coricamu",
"rev": "cdd2f7326efd91509caf84e69b669a7f9e6782bc",
"rev": "40db414609dc6d72319987d3e9d7b56fe405c28f",
"type": "github"
},
"original": {