mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
PhysicalDisplay: rename module to Monitor
This commit is contained in:
+6
-6
@@ -328,7 +328,7 @@ set(LIBFASTFETCH_SRC
|
||||
src/modules/locale/locale.c
|
||||
src/modules/localip/localip.c
|
||||
src/modules/memory/memory.c
|
||||
src/modules/physicaldisplay/physicaldisplay.c
|
||||
src/modules/monitor/monitor.c
|
||||
src/modules/opencl/opencl.c
|
||||
src/modules/opengl/opengl.c
|
||||
src/modules/os/os.c
|
||||
@@ -395,7 +395,7 @@ if(LINUX)
|
||||
src/detection/gamepad/gamepad_linux.c
|
||||
src/detection/media/media_linux.c
|
||||
src/detection/memory/memory_linux.c
|
||||
src/detection/physicaldisplay/physicaldisplay_linux.c
|
||||
src/detection/monitor/monitor_linux.c
|
||||
src/detection/opengl/opengl_linux.c
|
||||
src/detection/os/os_linux.c
|
||||
src/detection/packages/packages_linux.c
|
||||
@@ -441,7 +441,7 @@ elseif(ANDROID)
|
||||
src/detection/gamepad/gamepad_nosupport.c
|
||||
src/detection/media/media_nosupport.c
|
||||
src/detection/memory/memory_linux.c
|
||||
src/detection/physicaldisplay/physicaldisplay_nosupport.c
|
||||
src/detection/monitor/monitor_nosupport.c
|
||||
src/detection/opengl/opengl_linux.c
|
||||
src/detection/os/os_android.c
|
||||
src/detection/packages/packages_linux.c
|
||||
@@ -493,7 +493,7 @@ elseif(BSD)
|
||||
src/detection/gamepad/gamepad_bsd.c
|
||||
src/detection/media/media_linux.c
|
||||
src/detection/memory/memory_bsd.c
|
||||
src/detection/physicaldisplay/physicaldisplay_nosupport.c
|
||||
src/detection/monitor/monitor_nosupport.c
|
||||
src/detection/opengl/opengl_linux.c
|
||||
src/detection/os/os_linux.c
|
||||
src/detection/packages/packages_linux.c
|
||||
@@ -541,7 +541,7 @@ elseif(APPLE)
|
||||
src/detection/gamepad/gamepad_apple.c
|
||||
src/detection/media/media_apple.m
|
||||
src/detection/memory/memory_apple.c
|
||||
src/detection/physicaldisplay/physicaldisplay_apple.c
|
||||
src/detection/monitor/monitor_apple.c
|
||||
src/detection/opengl/opengl_apple.c
|
||||
src/detection/os/os_apple.m
|
||||
src/detection/packages/packages_apple.c
|
||||
@@ -588,7 +588,7 @@ elseif(WIN32)
|
||||
src/detection/gamepad/gamepad_windows.c
|
||||
src/detection/media/media_nosupport.c
|
||||
src/detection/memory/memory_windows.c
|
||||
src/detection/physicaldisplay/physicaldisplay_windows.c
|
||||
src/detection/monitor/monitor_windows.c
|
||||
src/detection/opengl/opengl_windows.c
|
||||
src/detection/os/os_windows.cpp
|
||||
src/detection/packages/packages_windows.c
|
||||
|
||||
@@ -95,7 +95,7 @@ All categories not listed here should work without needing a specific implementa
|
||||
|
||||
##### Available Modules
|
||||
```
|
||||
Battery, Bios, Bluetooth, Board, Break, Brightness, Colors, Command, CPU, CPUUsage, Cursor, Custom, Date, DateTime, DE, Disk, Display, Font, Gamepad, GPU, Host, Icons, Kernel, LM, Locale, LocalIP, Media, Memory, OpenCL, OpenGL, Packages, Physical Display, Player, Power Adapter, Processes, PublicIP, Separator, OS, Shell, Sound, Swap, Terminal, Terminal Font, Terminal Size, Theme, Time, Title, Uptime, Vulkan, Wallpaper, Wifi, WM, WMTheme
|
||||
Battery, Bios, Bluetooth, Board, Break, Brightness, Colors, Command, CPU, CPUUsage, Cursor, Custom, Date, DateTime, DE, Disk, Display, Font, Gamepad, GPU, Host, Icons, Kernel, LM, Locale, LocalIP, Media, Memory, Monitor, OpenCL, OpenGL, Packages, Player, Power Adapter, Processes, PublicIP, Separator, OS, Shell, Sound, Swap, Terminal, Terminal Font, Terminal Size, Theme, Time, Title, Uptime, Vulkan, Wallpaper, Wifi, WM, WMTheme
|
||||
```
|
||||
|
||||
##### Builtin logos
|
||||
|
||||
@@ -489,11 +489,11 @@
|
||||
"localip",
|
||||
"media",
|
||||
"memory",
|
||||
"monitor",
|
||||
"opencl",
|
||||
"opengl",
|
||||
"os",
|
||||
"packages",
|
||||
"physicaldisplay",
|
||||
"player",
|
||||
"poweradapter",
|
||||
"processes",
|
||||
@@ -562,10 +562,10 @@
|
||||
"locale",
|
||||
"media",
|
||||
"memory",
|
||||
"monitor",
|
||||
"opencl",
|
||||
"os",
|
||||
"packages",
|
||||
"physicaldisplay",
|
||||
"player",
|
||||
"poweradapter",
|
||||
"processes",
|
||||
|
||||
@@ -154,12 +154,7 @@ static bool parseModuleJsonObject(const char* type, yyjson_val* module)
|
||||
return
|
||||
tryModule(type, module, FF_MEDIA_MODULE_NAME, ffParseMediaJsonObject) ||
|
||||
tryModule(type, module, FF_MEMORY_MODULE_NAME, ffParseMemoryJsonObject) ||
|
||||
false;
|
||||
}
|
||||
|
||||
case 'N': {
|
||||
return
|
||||
tryModule(type, module, FF_PHYSICALDISPLAY_MODULE_NAME, ffParsePhysicalDisplayJsonObject) ||
|
||||
tryModule(type, module, FF_MONITOR_MODULE_NAME, ffParseMonitorJsonObject) ||
|
||||
false;
|
||||
}
|
||||
|
||||
|
||||
@@ -349,6 +349,7 @@
|
||||
#--shell-key Shell
|
||||
#--display-key Display {1}
|
||||
#--brightness-key Brightness ({1})
|
||||
#--monitor-key Monitor
|
||||
#--de-key DE
|
||||
#--wm-key WM
|
||||
#--wmtheme-key WM Theme
|
||||
@@ -372,7 +373,6 @@
|
||||
#--publicip-key Public IP
|
||||
#--wifi-key Wifi
|
||||
#--weather-key Weather
|
||||
#--physicaldisplay-key Physical Display
|
||||
#--player-key Media Player
|
||||
#--media-key Media
|
||||
#--datetime-key Date Time
|
||||
@@ -422,7 +422,7 @@
|
||||
#--localip-format
|
||||
#--publicip-format
|
||||
#--weather-format
|
||||
#--physicaldisplay-format
|
||||
#--monitor-format
|
||||
#--player-format
|
||||
#--media-format
|
||||
#--datetime-format
|
||||
@@ -469,7 +469,7 @@
|
||||
#--localip-key-color
|
||||
#--publicip-key-color
|
||||
#--weather-key-color
|
||||
#--physicaldisplay-key-color
|
||||
#--monitor-key-color
|
||||
#--player-key-color
|
||||
#--media-key-color
|
||||
#--datetime-key-color
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#include "fastfetch.h"
|
||||
|
||||
typedef struct FFPhysicalDisplayResult
|
||||
typedef struct FFMonitorResult
|
||||
{
|
||||
FFstrbuf name;
|
||||
uint32_t width; // native / maximum resolution, in pixels
|
||||
uint32_t height; // native / maximum resolution, in pixels
|
||||
uint32_t physicalWidth; // in mm
|
||||
uint32_t physicalHeight; // in mm
|
||||
} FFPhysicalDisplayResult;
|
||||
} FFMonitorResult;
|
||||
|
||||
const char* ffDetectPhysicalDisplay(FFlist* results);
|
||||
const char* ffDetectMonitor(FFlist* results);
|
||||
+10
-10
@@ -1,4 +1,4 @@
|
||||
#include "physicaldisplay.h"
|
||||
#include "monitor.h"
|
||||
#include "detection/displayserver/displayserver.h"
|
||||
#include "util/apple/cf_helpers.h"
|
||||
#include "util/apple/ddcci.h"
|
||||
@@ -23,18 +23,18 @@ static const char* detectWithDisplayServices(const FFDisplayServerResult* displa
|
||||
width <= 0 || height <= 0)
|
||||
continue;
|
||||
|
||||
FFPhysicalDisplayResult* physicalDisplay = (FFPhysicalDisplayResult*) ffListAdd(results);
|
||||
physicalDisplay->width = (uint32_t) width;
|
||||
physicalDisplay->height = (uint32_t) height;
|
||||
ffStrbufInit(&physicalDisplay->name);
|
||||
FFMonitorResult* monitor = (FFMonitorResult*) ffListAdd(results);
|
||||
monitor->width = (uint32_t) width;
|
||||
monitor->height = (uint32_t) height;
|
||||
ffStrbufInit(&monitor->name);
|
||||
|
||||
CFDictionaryRef productNames;
|
||||
if(!ffCfDictGetDict(displayInfo, CFSTR(kDisplayProductName), &productNames))
|
||||
ffCfDictGetString(productNames, CFSTR("en_US"), &physicalDisplay->name);
|
||||
ffCfDictGetString(productNames, CFSTR("en_US"), &monitor->name);
|
||||
|
||||
CGSize size = CGDisplayScreenSize((CGDirectDisplayID) display->id);
|
||||
physicalDisplay->physicalWidth = (uint32_t) (size.width + 0.5);
|
||||
physicalDisplay->physicalHeight = (uint32_t) (size.height + 0.5);
|
||||
monitor->physicalWidth = (uint32_t) (size.width + 0.5);
|
||||
monitor->physicalHeight = (uint32_t) (size.height + 0.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -91,7 +91,7 @@ static const char* detectWithDdcci(FFlist* results)
|
||||
ffEdidGetPhysicalResolution(edidData, &width, &height);
|
||||
if (width == 0 || height == 0) continue;
|
||||
|
||||
FFPhysicalDisplayResult* display = (FFPhysicalDisplayResult*) ffListAdd(results);
|
||||
FFMonitorResult* display = (FFMonitorResult*) ffListAdd(results);
|
||||
display->width = width;
|
||||
display->height = height;
|
||||
ffStrbufInit(&display->name);
|
||||
@@ -101,7 +101,7 @@ static const char* detectWithDdcci(FFlist* results)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char* ffDetectPhysicalDisplay(FFlist* results)
|
||||
const char* ffDetectMonitor(FFlist* results)
|
||||
{
|
||||
const FFDisplayServerResult* displayServer = ffConnectDisplayServer();
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
#include "physicaldisplay.h"
|
||||
#include "monitor.h"
|
||||
|
||||
#include "common/io/io.h"
|
||||
#include "util/edidHelper.h"
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include <dirent.h>
|
||||
|
||||
const char* ffDetectPhysicalDisplay(FFlist* results)
|
||||
const char* ffDetectMonitor(FFlist* results)
|
||||
{
|
||||
const char* drmDirPath = "/sys/class/drm/";
|
||||
|
||||
@@ -46,7 +46,7 @@ const char* ffDetectPhysicalDisplay(FFlist* results)
|
||||
if (tmp) plainName = tmp + 1;
|
||||
}
|
||||
|
||||
FFPhysicalDisplayResult* display = (FFPhysicalDisplayResult*) ffListAdd(results);
|
||||
FFMonitorResult* display = (FFMonitorResult*) ffListAdd(results);
|
||||
display->width = width;
|
||||
display->height = height;
|
||||
ffStrbufInitS(&display->name, plainName);
|
||||
@@ -0,0 +1,6 @@
|
||||
#include "monitor.h"
|
||||
|
||||
const char* ffDetectMonitor(FF_MAYBE_UNUSED FFlist* results)
|
||||
{
|
||||
return "Not supported on this platform";
|
||||
}
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
#include "physicaldisplay.h"
|
||||
#include "monitor.h"
|
||||
|
||||
#include "common/io/io.h"
|
||||
#include "util/edidHelper.h"
|
||||
@@ -16,7 +16,7 @@ static inline void wrapSetupDiDestroyDeviceInfoList(HDEVINFO* hdev)
|
||||
SetupDiDestroyDeviceInfoList(*hdev);
|
||||
}
|
||||
|
||||
const char* ffDetectPhysicalDisplay(FFlist* results)
|
||||
const char* ffDetectMonitor(FFlist* results)
|
||||
{
|
||||
//https://learn.microsoft.com/en-us/windows/win32/power/enumerating-battery-devices
|
||||
HDEVINFO hdev __attribute__((__cleanup__(wrapSetupDiDestroyDeviceInfoList))) =
|
||||
@@ -36,7 +36,7 @@ const char* ffDetectPhysicalDisplay(FFlist* results)
|
||||
ffEdidGetPhysicalResolution(edidData, &width, &height);
|
||||
if (width == 0 || height == 0) continue;
|
||||
|
||||
FFPhysicalDisplayResult* display = (FFPhysicalDisplayResult*) ffListAdd(results);
|
||||
FFMonitorResult* display = (FFMonitorResult*) ffListAdd(results);
|
||||
display->width = width;
|
||||
display->height = height;
|
||||
ffStrbufInit(&display->name);
|
||||
@@ -1,6 +0,0 @@
|
||||
#include "physicaldisplay.h"
|
||||
|
||||
const char* ffDetectPhysicalDisplay(FF_MAYBE_UNUSED FFlist* results)
|
||||
{
|
||||
return "Not supported on this platform";
|
||||
}
|
||||
+15
-15
@@ -200,6 +200,18 @@ static inline void printCommandHelp(const char* command)
|
||||
"Screen name"
|
||||
);
|
||||
}
|
||||
else if(ffStrEqualsIgnCase(command, "monitor-format"))
|
||||
{
|
||||
constructAndPrintCommandHelpFormat("monitor", "{}", 6,
|
||||
"Display name",
|
||||
"Display native resolution width in pixels",
|
||||
"Display native resolution height in pixels",
|
||||
"Display physical width in millimeters",
|
||||
"Display physical height in millimeters",
|
||||
"Display physical diagonal length in inches",
|
||||
"Display physical pixels per inch (PPI)"
|
||||
);
|
||||
}
|
||||
else if(ffStrEqualsIgnCase(command, "de-format"))
|
||||
{
|
||||
constructAndPrintCommandHelpFormat("de", "{2} {3}", 3,
|
||||
@@ -400,18 +412,6 @@ static inline void printCommandHelp(const char* command)
|
||||
"Connection Security algorithm"
|
||||
);
|
||||
}
|
||||
else if(ffStrEqualsIgnCase(command, "physicaldisplay-format"))
|
||||
{
|
||||
constructAndPrintCommandHelpFormat("physicaldisplay", "{}", 6,
|
||||
"Display name",
|
||||
"Display native resolution width in pixels",
|
||||
"Display native resolution height in pixels",
|
||||
"Display physical width in millimeters",
|
||||
"Display physical height in millimeters",
|
||||
"Display physical diagonal length in inches",
|
||||
"Display physical pixels per inch (PPI)"
|
||||
);
|
||||
}
|
||||
else if(ffStrEqualsIgnCase(command, "player-format"))
|
||||
{
|
||||
constructAndPrintCommandHelpFormat("player", "{}", 4,
|
||||
@@ -1010,6 +1010,7 @@ static void parseOption(FFdata* data, const char* key, const char* value)
|
||||
else if(ffParseShellCommandOptions(&instance.config.shell, key, value)) {}
|
||||
else if(ffParseDisplayCommandOptions(&instance.config.display, key, value)) {}
|
||||
else if(ffParseBrightnessCommandOptions(&instance.config.brightness, key, value)) {}
|
||||
else if(ffParseMonitorCommandOptions(&instance.config.nativeResolution, key, value)) {}
|
||||
else if(ffParseDECommandOptions(&instance.config.de, key, value)) {}
|
||||
else if(ffParseWifiCommandOptions(&instance.config.wifi, key, value)) {}
|
||||
else if(ffParseWMCommandOptions(&instance.config.wm, key, value)) {}
|
||||
@@ -1037,7 +1038,6 @@ static void parseOption(FFdata* data, const char* key, const char* value)
|
||||
else if(ffParseWeatherCommandOptions(&instance.config.weather, key, value)) {}
|
||||
else if(ffParsePlayerCommandOptions(&instance.config.player, key, value)) {}
|
||||
else if(ffParseMediaCommandOptions(&instance.config.media, key, value)) {}
|
||||
else if(ffParsePhysicalDisplayCommandOptions(&instance.config.nativeResolution, key, value)) {}
|
||||
else if(ffParseDateTimeCommandOptions(&instance.config.dateTime, key, value)) {}
|
||||
else if(ffParseVulkanCommandOptions(&instance.config.vulkan, key, value)) {}
|
||||
else if(ffParseOpenGLCommandOptions(&instance.config.openGL, key, value)) {}
|
||||
@@ -1271,8 +1271,8 @@ static void parseStructureCommand(const char* line, FFlist* customValues)
|
||||
ffPrintPlayer(&instance.config.player);
|
||||
else if(ffStrEqualsIgnCase(line, FF_MEDIA_MODULE_NAME))
|
||||
ffPrintMedia(&instance.config.media);
|
||||
else if(ffStrEqualsIgnCase(line, FF_PHYSICALDISPLAY_MODULE_NAME))
|
||||
ffPrintPhysicalDisplay(&instance.config.nativeResolution);
|
||||
else if(ffStrEqualsIgnCase(line, FF_MONITOR_MODULE_NAME))
|
||||
ffPrintMonitor(&instance.config.nativeResolution);
|
||||
else if(ffStrEqualsIgnCase(line, FF_DATETIME_MODULE_NAME))
|
||||
ffPrintDateTime(&instance.config.dateTime);
|
||||
else if(ffStrEqualsIgnCase(line, FF_COLORS_MODULE_NAME))
|
||||
|
||||
+1
-1
@@ -110,7 +110,7 @@ typedef struct FFconfig
|
||||
FFWeatherOptions weather;
|
||||
FFPlayerOptions player;
|
||||
FFMediaOptions media;
|
||||
FFPhysicalDisplayOptions nativeResolution;
|
||||
FFMonitorOptions nativeResolution;
|
||||
FFDateTimeOptions dateTime;
|
||||
FFVulkanOptions vulkan;
|
||||
FFOpenGLOptions openGL;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "modules/localip/localip.h"
|
||||
#include "modules/media/media.h"
|
||||
#include "modules/memory/memory.h"
|
||||
#include "modules/physicaldisplay/physicaldisplay.h"
|
||||
#include "modules/monitor/monitor.h"
|
||||
#include "modules/opengl/opengl.h"
|
||||
#include "modules/opencl/opencl.h"
|
||||
#include "modules/os/os.h"
|
||||
|
||||
@@ -1,35 +1,34 @@
|
||||
#include "common/printing.h"
|
||||
#include "common/jsonconfig.h"
|
||||
#include "detection/physicaldisplay/physicaldisplay.h"
|
||||
#include "modules/physicaldisplay/physicaldisplay.h"
|
||||
#include "detection/monitor/monitor.h"
|
||||
#include "modules/monitor/monitor.h"
|
||||
#include "util/stringUtils.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#define FF_PHYSICALDISPLAY_DISPLAY_NAME "Physical Display"
|
||||
#define FF_PHYSICALDISPLAY_NUM_FORMAT_ARGS 7
|
||||
#define FF_MONITOR_NUM_FORMAT_ARGS 7
|
||||
|
||||
void ffPrintPhysicalDisplay(FFPhysicalDisplayOptions* options)
|
||||
void ffPrintMonitor(FFMonitorOptions* options)
|
||||
{
|
||||
FF_LIST_AUTO_DESTROY result = ffListCreate(sizeof(FFPhysicalDisplayResult));
|
||||
FF_LIST_AUTO_DESTROY result = ffListCreate(sizeof(FFMonitorResult));
|
||||
|
||||
const char* error = ffDetectPhysicalDisplay(&result);
|
||||
const char* error = ffDetectMonitor(&result);
|
||||
|
||||
if(error)
|
||||
{
|
||||
ffPrintError(FF_PHYSICALDISPLAY_DISPLAY_NAME, 0, &options->moduleArgs, "%s", error);
|
||||
ffPrintError(FF_MONITOR_MODULE_NAME, 0, &options->moduleArgs, "%s", error);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!result.length)
|
||||
{
|
||||
ffPrintError(FF_PHYSICALDISPLAY_DISPLAY_NAME, 0, &options->moduleArgs, "No physical display detected");
|
||||
ffPrintError(FF_MONITOR_MODULE_NAME, 0, &options->moduleArgs, "No physical display detected");
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t index = 0;
|
||||
FF_STRBUF_AUTO_DESTROY key = ffStrbufCreate();
|
||||
FF_LIST_FOR_EACH(FFPhysicalDisplayResult, display, result)
|
||||
FF_LIST_FOR_EACH(FFMonitorResult, display, result)
|
||||
{
|
||||
double inch = sqrt(display->physicalWidth * display->physicalWidth + display->physicalHeight * display->physicalHeight) / 25.4;
|
||||
double ppi = sqrt(display->width * display->width + display->height * display->height) / inch;
|
||||
@@ -39,7 +38,7 @@ void ffPrintPhysicalDisplay(FFPhysicalDisplayOptions* options)
|
||||
ffStrbufClear(&key);
|
||||
if(options->moduleArgs.key.length == 0)
|
||||
{
|
||||
ffStrbufAppendF(&key, "%s (%s)", FF_PHYSICALDISPLAY_DISPLAY_NAME, display->name.chars);
|
||||
ffStrbufAppendF(&key, "%s (%s)", FF_MONITOR_MODULE_NAME, display->name.chars);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -57,7 +56,7 @@ void ffPrintPhysicalDisplay(FFPhysicalDisplayOptions* options)
|
||||
}
|
||||
else
|
||||
{
|
||||
ffPrintFormat(FF_PHYSICALDISPLAY_DISPLAY_NAME, index, &options->moduleArgs, FF_PHYSICALDISPLAY_NUM_FORMAT_ARGS, (FFformatarg[]) {
|
||||
ffPrintFormat(FF_MONITOR_MODULE_NAME, index, &options->moduleArgs, FF_MONITOR_NUM_FORMAT_ARGS, (FFformatarg[]) {
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &display->name},
|
||||
{FF_FORMAT_ARG_TYPE_UINT, &display->width},
|
||||
{FF_FORMAT_ARG_TYPE_UINT, &display->height},
|
||||
@@ -72,15 +71,15 @@ void ffPrintPhysicalDisplay(FFPhysicalDisplayOptions* options)
|
||||
}
|
||||
}
|
||||
|
||||
void ffInitPhysicalDisplayOptions(FFPhysicalDisplayOptions* options)
|
||||
void ffInitMonitorOptions(FFMonitorOptions* options)
|
||||
{
|
||||
options->moduleName = FF_PHYSICALDISPLAY_MODULE_NAME;
|
||||
options->moduleName = FF_MONITOR_MODULE_NAME;
|
||||
ffOptionInitModuleArg(&options->moduleArgs);
|
||||
}
|
||||
|
||||
bool ffParsePhysicalDisplayCommandOptions(FFPhysicalDisplayOptions* options, const char* key, const char* value)
|
||||
bool ffParseMonitorCommandOptions(FFMonitorOptions* options, const char* key, const char* value)
|
||||
{
|
||||
const char* subKey = ffOptionTestPrefix(key, FF_PHYSICALDISPLAY_MODULE_NAME);
|
||||
const char* subKey = ffOptionTestPrefix(key, FF_MONITOR_MODULE_NAME);
|
||||
if (!subKey) return false;
|
||||
if (ffOptionParseModuleArgs(key, subKey, value, &options->moduleArgs))
|
||||
return true;
|
||||
@@ -88,15 +87,15 @@ bool ffParsePhysicalDisplayCommandOptions(FFPhysicalDisplayOptions* options, con
|
||||
return false;
|
||||
}
|
||||
|
||||
void ffDestroyPhysicalDisplayOptions(FFPhysicalDisplayOptions* options)
|
||||
void ffDestroyMonitorOptions(FFMonitorOptions* options)
|
||||
{
|
||||
ffOptionDestroyModuleArg(&options->moduleArgs);
|
||||
}
|
||||
|
||||
void ffParsePhysicalDisplayJsonObject(yyjson_val* module)
|
||||
void ffParseMonitorJsonObject(yyjson_val* module)
|
||||
{
|
||||
FFPhysicalDisplayOptions __attribute__((__cleanup__(ffDestroyPhysicalDisplayOptions))) options;
|
||||
ffInitPhysicalDisplayOptions(&options);
|
||||
FFMonitorOptions __attribute__((__cleanup__(ffDestroyMonitorOptions))) options;
|
||||
ffInitMonitorOptions(&options);
|
||||
|
||||
if (module)
|
||||
{
|
||||
@@ -111,9 +110,9 @@ void ffParsePhysicalDisplayJsonObject(yyjson_val* module)
|
||||
if (ffJsonConfigParseModuleArgs(key, val, &options.moduleArgs))
|
||||
continue;
|
||||
|
||||
ffPrintError(FF_PHYSICALDISPLAY_MODULE_NAME, 0, &options.moduleArgs, "Unknown JSON key %s", key);
|
||||
ffPrintError(FF_MONITOR_MODULE_NAME, 0, &options.moduleArgs, "Unknown JSON key %s", key);
|
||||
}
|
||||
}
|
||||
|
||||
ffPrintPhysicalDisplay(&options);
|
||||
ffPrintMonitor(&options);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "fastfetch.h"
|
||||
|
||||
#define FF_MONITOR_MODULE_NAME "Monitor"
|
||||
|
||||
void ffPrintMonitor(FFMonitorOptions* options);
|
||||
void ffInitMonitorOptions(FFMonitorOptions* options);
|
||||
bool ffParseMonitorCommandOptions(FFMonitorOptions* options, const char* key, const char* value);
|
||||
void ffDestroyMonitorOptions(FFMonitorOptions* options);
|
||||
void ffParseMonitorJsonObject(yyjson_val* module);
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
#include "common/option.h"
|
||||
|
||||
typedef struct FFPhysicalDisplayOptions
|
||||
typedef struct FFMonitorOptions
|
||||
{
|
||||
const char* moduleName;
|
||||
FFModuleArgs moduleArgs;
|
||||
} FFPhysicalDisplayOptions;
|
||||
} FFMonitorOptions;
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "modules/localip/option.h"
|
||||
#include "modules/media/option.h"
|
||||
#include "modules/memory/option.h"
|
||||
#include "modules/physicaldisplay/option.h"
|
||||
#include "modules/monitor/option.h"
|
||||
#include "modules/opengl/option.h"
|
||||
#include "modules/opencl/option.h"
|
||||
#include "modules/os/option.h"
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "fastfetch.h"
|
||||
|
||||
#define FF_PHYSICALDISPLAY_MODULE_NAME "PhysicalDisplay"
|
||||
|
||||
void ffPrintPhysicalDisplay(FFPhysicalDisplayOptions* options);
|
||||
void ffInitPhysicalDisplayOptions(FFPhysicalDisplayOptions* options);
|
||||
bool ffParsePhysicalDisplayCommandOptions(FFPhysicalDisplayOptions* options, const char* key, const char* value);
|
||||
void ffDestroyPhysicalDisplayOptions(FFPhysicalDisplayOptions* options);
|
||||
void ffParsePhysicalDisplayJsonObject(yyjson_val* module);
|
||||
Reference in New Issue
Block a user