2021-02-18 22:25:36 +01:00
|
|
|
#include "fastfetch.h"
|
|
|
|
|
|
2021-05-15 12:36:25 +02:00
|
|
|
void ffPrintSeparator(FFinstance* instance)
|
2021-02-18 22:25:36 +01:00
|
|
|
{
|
2021-06-15 11:04:44 +02:00
|
|
|
const FFTitleResult* result = ffDetectTitle(instance);
|
|
|
|
|
uint32_t titleLength = result->userName.length + 1 + result->hostname.length;
|
|
|
|
|
|
2022-06-08 10:59:33 +02:00
|
|
|
ffLogoPrintLine(instance);
|
2021-02-18 22:25:36 +01:00
|
|
|
|
2021-11-18 18:25:24 +01:00
|
|
|
if(instance->config.separatorString.length == 0)
|
|
|
|
|
{
|
|
|
|
|
for(uint32_t i = 0; i < titleLength; i++)
|
|
|
|
|
putchar('-');
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//Write the whole separator as often as it fits fully into titleLength
|
|
|
|
|
for(uint32_t i = 0; i < titleLength / instance->config.separatorString.length; i++)
|
|
|
|
|
ffStrbufWriteTo(&instance->config.separatorString, stdout);
|
|
|
|
|
|
|
|
|
|
//Write as much of the separator as needed to fill titleLength
|
|
|
|
|
for(uint32_t i = 0; i < titleLength % instance->config.separatorString.length; i++)
|
|
|
|
|
putchar(instance->config.separatorString.chars[i]);
|
|
|
|
|
}
|
2021-02-18 22:25:36 +01:00
|
|
|
putchar('\n');
|
2021-03-27 18:14:19 +01:00
|
|
|
}
|