mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-06 13:14:21 +01:00
removed ffStrbufIsEmpty
This commit is contained in:
+15
-16
@@ -6,10 +6,10 @@
|
||||
static int getCurrentRate(FFinstance* instance, Display* display)
|
||||
{
|
||||
void* xrandr;
|
||||
if(!ffStrbufIsEmpty(&instance->config.libXrandr))
|
||||
xrandr = dlopen(instance->config.libXrandr.chars, RTLD_LAZY);
|
||||
else
|
||||
if(instance->config.libXrandr.length == 0)
|
||||
xrandr = dlopen("libXrandr.so", RTLD_LAZY);
|
||||
else
|
||||
xrandr = dlopen(instance->config.libXrandr.chars, RTLD_LAZY);
|
||||
if(xrandr == NULL)
|
||||
return 0;
|
||||
|
||||
@@ -44,10 +44,10 @@ void ffPrintResolution(FFinstance* instance)
|
||||
return;
|
||||
|
||||
void* x11;
|
||||
if(!ffStrbufIsEmpty(&instance->config.libX11))
|
||||
x11 = dlopen(instance->config.libX11.chars, RTLD_LAZY);
|
||||
else
|
||||
if(instance->config.libX11.length == 0)
|
||||
x11 = dlopen("libX11.so", RTLD_LAZY);
|
||||
else
|
||||
x11 = dlopen(instance->config.libX11.chars, RTLD_LAZY);
|
||||
if(x11 == NULL)
|
||||
{
|
||||
ffPrintError(instance, "Resolution", "dlopen(\"libX11.so\", RTLD_LAZY) == NULL");
|
||||
@@ -76,22 +76,21 @@ void ffPrintResolution(FFinstance* instance)
|
||||
|
||||
FF_STRBUF_CREATE(resolution);
|
||||
|
||||
if(!ffStrbufIsEmpty(&instance->config.resolutionFormat))
|
||||
{
|
||||
|
||||
ffParseFormatString(&resolution, &instance->config.resolutionFormat, 3,
|
||||
(FFformatarg){FF_FORMAT_ARG_TYPE_INT, &screen->width},
|
||||
(FFformatarg){FF_FORMAT_ARG_TYPE_INT, &screen->height},
|
||||
(FFformatarg){FF_FORMAT_ARG_TYPE_INT, ¤tRate}
|
||||
);
|
||||
}
|
||||
else
|
||||
if(instance->config.resolutionFormat.length == 0)
|
||||
{
|
||||
ffStrbufAppendF(&resolution, "%ix%i", screen->width, screen->height);
|
||||
|
||||
if(currentRate > 0)
|
||||
ffStrbufAppendF(&resolution, " @ %iHz", currentRate);
|
||||
}
|
||||
else
|
||||
{
|
||||
ffParseFormatString(&resolution, &instance->config.resolutionFormat, 3,
|
||||
(FFformatarg){FF_FORMAT_ARG_TYPE_INT, &screen->width},
|
||||
(FFformatarg){FF_FORMAT_ARG_TYPE_INT, &screen->height},
|
||||
(FFformatarg){FF_FORMAT_ARG_TYPE_INT, ¤tRate}
|
||||
);
|
||||
}
|
||||
|
||||
ffPrintAndSaveCachedValue(instance, "Resolution", &resolution);
|
||||
ffStrbufDestroy(&resolution);
|
||||
|
||||
Reference in New Issue
Block a user