mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 00:03:58 +01:00
Separator: honors FQDN settings in Title module
This commit is contained in:
@@ -56,7 +56,6 @@ void ffPrintSeparator(FFSeparatorOptions* options)
|
||||
{
|
||||
setlocale(LC_CTYPE, "");
|
||||
mbstate_t state = {};
|
||||
bool fqdn = true; // TODO: Make this configurable
|
||||
const FFPlatform* platform = &instance.state.platform;
|
||||
|
||||
FF_AUTO_FREE wchar_t* wstr = malloc((max(
|
||||
@@ -64,7 +63,7 @@ void ffPrintSeparator(FFSeparatorOptions* options)
|
||||
|
||||
uint32_t titleLength = 1 // @
|
||||
+ getWcsWidth(&platform->userName, wstr, &state) // user name
|
||||
+ (fqdn ? platform->hostName.length : ffStrbufFirstIndexC(&platform->hostName, '.')); // host name
|
||||
+ (instance.state.titleFqdn ? platform->hostName.length : ffStrbufFirstIndexC(&platform->hostName, '.')); // host name
|
||||
|
||||
if(__builtin_expect(options->string.length == 1, 1))
|
||||
{
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include "common/jsonconfig.h"
|
||||
#include "modules/title/title.h"
|
||||
#include "util/textModifier.h"
|
||||
#include "util/stringUtils.h"
|
||||
|
||||
static void appendText(FFstrbuf* output, const FFstrbuf* text, const FFstrbuf* color)
|
||||
{
|
||||
@@ -30,6 +29,7 @@ void ffPrintTitle(FFTitleOptions* options)
|
||||
FF_STRBUF_AUTO_DESTROY hostName = ffStrbufCreateCopy(&instance.state.platform.hostName);
|
||||
if (!options->fqdn)
|
||||
ffStrbufSubstrBeforeFirstC(&hostName, '.');
|
||||
instance.state.titleFqdn = options->fqdn;
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY hostNameColored = ffStrbufCreate();
|
||||
appendText(&hostNameColored, &hostName, &options->colorHost);
|
||||
|
||||
Reference in New Issue
Block a user