mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 19:50:45 +01:00
32 lines
1.1 KiB
C
32 lines
1.1 KiB
C
#include "resolution.h"
|
|
|
|
void ffPrintResolutionValue(FFinstance* instance, uint8_t moduleIndex, FFcache* cache, int width, int height, int refreshRate)
|
|
{
|
|
FFstrbuf value;
|
|
ffStrbufInitA(&value, 32);
|
|
ffStrbufAppendF(&value, "%ix%i", width, height);
|
|
|
|
if(refreshRate > 0)
|
|
ffStrbufAppendF(&value, " @ %iHz", refreshRate);
|
|
|
|
ffPrintAndAppendToCache(instance, FF_RESOLUTION_MODULE_NAME, moduleIndex, &instance->config.resolutionKey, cache, &value, &instance->config.resolutionFormat, FF_RESOLUTION_NUM_FORMAT_ARGS, (FFformatarg[]){
|
|
{FF_FORMAT_ARG_TYPE_INT, &width},
|
|
{FF_FORMAT_ARG_TYPE_INT, &height},
|
|
{FF_FORMAT_ARG_TYPE_INT, &refreshRate}
|
|
});
|
|
}
|
|
|
|
void ffPrintResolution(FFinstance* instance)
|
|
{
|
|
if(ffPrintFromCache(instance, FF_RESOLUTION_MODULE_NAME, &instance->config.resolutionKey, &instance->config.resolutionFormat, FF_RESOLUTION_NUM_FORMAT_ARGS))
|
|
return;
|
|
|
|
if(ffPrintResolutionWaylandBackend(instance))
|
|
return;
|
|
|
|
if(ffPrintResolutionXrandrBackend(instance))
|
|
return;
|
|
|
|
ffPrintResolutionX11Backend(instance);
|
|
}
|