mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 00:37:23 +01:00
README: document image logo support
This commit is contained in:
@@ -95,7 +95,15 @@ AlmaLinux, Alpine, Android, Arch, Arco, Artix, Bedrock, CachyOS, CentOS, CRUX, C
|
||||
* Some logos have an old variant. Access it by appending _old to the logo name.
|
||||
* To disable the logo, use `--logo none`.
|
||||
* Get a list of all available logos with `fastfetch --print-logos`.
|
||||
* Printing images as logo is supported using Sixel / Kitty / iTerm graphics protocol or chafas image to text conversion.
|
||||
|
||||
###### Image logo
|
||||
|
||||
Printing images as logo is supported using Sixel / Kitty / iTerm graphics protocol or chafas image to text conversion.
|
||||
|
||||
* Sixel: fastfetch must be built with imagemagick support to convert image to sixel format
|
||||
* Kitty: Because [kitty support png](https://sw.kovidgoyal.net/kitty/graphics-protocol/#png-data) natively, using `png` image file with both `--logo-width` and `--logo-height` being specified is recommanded to get maximum performance. Otherwise, imagemagick is required to convert image to RGBA data.
|
||||
* iTerm: [Since iTerm supports a lot of image format](https://iterm2.com/documentation-images.html), imagemagick support is not required. However, both `--logo-width` and `--logo-height` must be specified since fastfetch has no idea about the size of the image.
|
||||
* Chafa: Requires imagemagick support.
|
||||
|
||||
##### Package managers
|
||||
```
|
||||
|
||||
@@ -30,12 +30,18 @@ static FFstrbuf base64Encode(FFstrbuf* in)
|
||||
static bool printImageIterm(FFinstance* instance)
|
||||
{
|
||||
if(instance->config.logo.width == 0 || instance->config.logo.height == 0)
|
||||
{
|
||||
fputs("Logo: `item` protocol only works when both `--logo-width` and `--logo-height` being specified\n", stderr);
|
||||
return false;
|
||||
}
|
||||
|
||||
FFstrbuf buf;
|
||||
ffStrbufInit(&buf);
|
||||
if(!ffAppendFileBuffer(instance->config.logo.source.chars, &buf))
|
||||
{
|
||||
fputs("Logo: failed to load image file\n", stderr);
|
||||
return false;
|
||||
}
|
||||
|
||||
ffPrintCharTimes(' ', instance->config.logo.paddingLeft);
|
||||
FFstrbuf base64 = base64Encode(&buf);
|
||||
|
||||
Reference in New Issue
Block a user