mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 16:26:39 +01:00
Display: always show display name
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
#include "common/printing.h"
|
||||
#include "common/jsonconfig.h"
|
||||
#include "detection/brightness/brightness.h"
|
||||
#include "detection/displayserver/displayserver.h"
|
||||
#include "modules/brightness/brightness.h"
|
||||
#include "util/stringUtils.h"
|
||||
|
||||
@@ -12,8 +11,6 @@ void ffPrintBrightness(FFinstance* instance, FFBrightnessOptions* options)
|
||||
{
|
||||
FF_LIST_AUTO_DESTROY result = ffListCreate(sizeof(FFBrightnessResult));
|
||||
|
||||
const FFDisplayServerResult* ds = ffConnectDisplayServer(instance);
|
||||
|
||||
const char* error = ffDetectBrightness(&result);
|
||||
|
||||
if(error)
|
||||
@@ -34,9 +31,7 @@ void ffPrintBrightness(FFinstance* instance, FFBrightnessOptions* options)
|
||||
{
|
||||
if(options->moduleArgs.key.length == 0)
|
||||
{
|
||||
ffStrbufAppendS(&key, FF_BRIGHTNESS_MODULE_NAME);
|
||||
if (ds->displays.length > 1)
|
||||
ffStrbufAppendF(&key, " (%s)", item->name.chars);
|
||||
ffStrbufAppendF(&key, "%s (%s)", FF_BRIGHTNESS_MODULE_NAME, item->name.chars);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -53,27 +53,20 @@ void ffPrintDisplay(FFinstance* instance, FFDisplayOptions* options)
|
||||
|
||||
if(options->moduleArgs.outputFormat.length == 0)
|
||||
{
|
||||
if(moduleIndex > 0)
|
||||
ffStrbufClear(&key);
|
||||
if(options->moduleArgs.key.length == 0)
|
||||
{
|
||||
ffStrbufClear(&key);
|
||||
if(options->moduleArgs.key.length == 0)
|
||||
{
|
||||
ffStrbufAppendF(&key, "%s (%s)", FF_DISPLAY_MODULE_NAME, result->name.length ? result->name.chars : displayType);
|
||||
}
|
||||
else
|
||||
{
|
||||
ffParseFormatString(&key, &options->moduleArgs.key, 1, (FFformatarg[]){
|
||||
{FF_FORMAT_ARG_TYPE_UINT, &i},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &result->name},
|
||||
{FF_FORMAT_ARG_TYPE_STRING, displayType},
|
||||
});
|
||||
}
|
||||
ffPrintLogoAndKey(instance, key.chars, 0, NULL, &options->moduleArgs.keyColor);
|
||||
ffStrbufAppendF(&key, "%s (%s)", FF_DISPLAY_MODULE_NAME, result->name.length ? result->name.chars : displayType);
|
||||
}
|
||||
else
|
||||
{
|
||||
ffPrintLogoAndKey(instance, FF_DISPLAY_MODULE_NAME, moduleIndex, &options->moduleArgs.key, &options->moduleArgs.keyColor);
|
||||
ffParseFormatString(&key, &options->moduleArgs.key, 1, (FFformatarg[]){
|
||||
{FF_FORMAT_ARG_TYPE_UINT, &i},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &result->name},
|
||||
{FF_FORMAT_ARG_TYPE_STRING, displayType},
|
||||
});
|
||||
}
|
||||
ffPrintLogoAndKey(instance, key.chars, 0, NULL, &options->moduleArgs.keyColor);
|
||||
|
||||
printf("%ix%i", result->width, result->height);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user