mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
1.5 KiB
1.5 KiB
Development help
This file is not an official documentation! Here i just add things that are easy to forget.
Adding a logo
Assuming foobar is the name of the logo:
In src/common/logo.c:
- create method
initLogoFoobar(FFinstance* instance), at alphabetic ordered placement. Set the fields ofinstance->logo:instance->config.logo.lines = "$1Foo\n" " $2bar"; instance->config.logo.colors[0] = "\033[32m"; //green instance->config.logo.colors[1] = "\033[35m"; //magenta - go to method
loadLogoSetand add an if at alphabetical position to load it:else if(strcasecmp(logo, "foobar") == 0) initLogoFoobar(instance); - if different logos exist for different versions, differ betwenn them in
loadLogoSetWithVersion:[...] bool isFoobar = ffStrbufIgnCaseCompS(name, "foobar") == 0; if(versionID->length == 0 || ( [...] && !isFoobar )) return loadLogoSet(instance, name->chars); [...] if(isFoobar) { if(version > 64) return loadLogoSet(instance, "foobar"); else return loadLogoSet(instance, "foobar_old"); } - go to
ffPrintLogosand atFF_LOGO_PRINTat alphabetical position:FF_LOGO_PRINT(foobar, initLogoFoobar)
In src/data/logos.txt:
- Add the name of the logo at alphabetical position.
[...] foobar [...]
In README.md:
- Add the pretty name of the logo to the list of supported logos
[...] Foobar, [...]