mirror of
https://github.com/NotAShelf/microfetch.git
synced 2026-04-12 21:07:41 +00:00
docs: describe custom logo support; revise 'customizing' section
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I6e9b904fcd228aa74119e4c09c486f756a6a6964
This commit is contained in:
parent
8324b35661
commit
d118e591d0
1 changed files with 34 additions and 13 deletions
|
|
@ -41,9 +41,9 @@ welcome to use it on your system: it is pretty _[fast](#benchmarks)_...
|
||||||
- Fast
|
- Fast
|
||||||
- Really fast
|
- Really fast
|
||||||
- No dependencies (not even libc!)
|
- No dependencies (not even libc!)
|
||||||
- Tiny binary (~25kb)
|
- Tiny binary (~24kb)
|
||||||
- Actually _really_ fast
|
- Actually _really_ fast
|
||||||
- Cool NixOS logo (other, inferior, distros are not supported)
|
- Cool NixOS logo, with support for custom logo text
|
||||||
- Reliable detection of following info:
|
- Reliable detection of following info:
|
||||||
- Hostname/Username
|
- Hostname/Username
|
||||||
- Kernel
|
- Kernel
|
||||||
|
|
@ -234,20 +234,11 @@ interested in Microfetch tailored to their distributions.
|
||||||
|
|
||||||
## Customizing
|
## Customizing
|
||||||
|
|
||||||
You can't*.
|
You can't*
|
||||||
|
|
||||||
### Why?
|
|
||||||
|
|
||||||
Customization, of most kinds, is "expensive": I could try reading environment
|
|
||||||
variables, parse command-line arguments or read a configuration file to allow
|
|
||||||
configuring various fields but those inflate execution time and the resource
|
|
||||||
consumption by a lot. Since Microfetch is closer to a code golf challenge than a
|
|
||||||
program that attempts to fill a gap, I have elected not to make this trade. This
|
|
||||||
is, of course, not without a solution.
|
|
||||||
|
|
||||||
### Really?
|
### Really?
|
||||||
|
|
||||||
[main module]: ./src/main.rs
|
[main module]: ./microfetch/src/main.rs
|
||||||
[discussions tab]: https://github.com/NotAShelf/microfetch/discussions
|
[discussions tab]: https://github.com/NotAShelf/microfetch/discussions
|
||||||
|
|
||||||
To be fair, you _can_ customize Microfetch by, well, patching it. It is
|
To be fair, you _can_ customize Microfetch by, well, patching it. It is
|
||||||
|
|
@ -265,6 +256,36 @@ The Nix package allows passing patches in a streamlined manner by passing
|
||||||
share your derivations with people. Feel free to use the [discussions tab] to
|
share your derivations with people. Feel free to use the [discussions tab] to
|
||||||
share your own variants of Microfetch!
|
share your own variants of Microfetch!
|
||||||
|
|
||||||
|
The real reason behind lack of customizability is that customization, of most
|
||||||
|
kinds, is "expensive": reading environment variables, parsing command-line
|
||||||
|
arguments or reading a configuration file inflates execution time and resource
|
||||||
|
consumption. Since Microfetch is closer to a code golf challenge than a program
|
||||||
|
that attempts to fill a gap, runtime configuration is not supported. Patching
|
||||||
|
the source is the only way to make changes that do not compromise on speed. The
|
||||||
|
exception to this, as described below, is the custom logo support.
|
||||||
|
|
||||||
|
### Logo
|
||||||
|
|
||||||
|
Microfetch used to be impossible to customize without patching. Fortunately it's
|
||||||
|
possible now to customize the logo to support your distribution. This is
|
||||||
|
best-effort, but should work for most cases as long as you adhere to the
|
||||||
|
constraints.
|
||||||
|
|
||||||
|
To use a custom logo, set the `MICROFETCH_LOGO` environment variable to 9
|
||||||
|
newline-separated lines of ASCII or Unicode art when building:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Pass your logo text with MICROFETCH_LOGO.
|
||||||
|
$ MICROFETCH_LOGO="$(cat my_logo.txt)" cargo build --release
|
||||||
|
```
|
||||||
|
|
||||||
|
Each line corresponds to one info row. Nerd Font glyphs for labels (System,
|
||||||
|
Kernel, Shell, etc.) are rendered automatically. An unset variable uses the
|
||||||
|
built-in two-tone NixOS logo.
|
||||||
|
|
||||||
|
Keep in mind that the custom logo **is not padded**. You will need to mind the
|
||||||
|
spaces if you're providing a custom logo for some sort.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
I will, mostly, reject feature additions. This is not to say you should avoid
|
I will, mostly, reject feature additions. This is not to say you should avoid
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue