mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Break: support JSON config
This commit is contained in:
+1
-1
@@ -266,7 +266,7 @@ set(LIBFASTFETCH_SRC
|
||||
src/modules/bluetooth/bluetooth.c
|
||||
src/modules/board/board.c
|
||||
src/modules/brightness.c
|
||||
src/modules/break.c
|
||||
src/modules/break/break.c
|
||||
src/modules/chassis.c
|
||||
src/modules/colors.c
|
||||
src/modules/cpu.c
|
||||
|
||||
@@ -250,7 +250,6 @@ void ffPrepareWeather(FFinstance* instance);
|
||||
//Printing
|
||||
|
||||
void ffPrintCustom(FFinstance* instance, const char* key, const char* value);
|
||||
void ffPrintBreak(FFinstance* instance);
|
||||
void ffPrintChassis(FFinstance* instance);
|
||||
void ffPrintUptime(FFinstance* instance);
|
||||
void ffPrintProcesses(FFinstance* instance);
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#include "fastfetch.h"
|
||||
#include "common/printing.h"
|
||||
|
||||
void ffPrintBreak(FFinstance* instance)
|
||||
{
|
||||
ffLogoPrintLine(instance);
|
||||
putchar('\n');
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#include "fastfetch.h"
|
||||
#include "common/printing.h"
|
||||
#include "modules/break/break.h"
|
||||
|
||||
#define FF_BREAK_MODULE_NAME "Break"
|
||||
|
||||
void ffPrintBreak(FFinstance* instance)
|
||||
{
|
||||
ffLogoPrintLine(instance);
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
#ifdef FF_HAVE_JSONC
|
||||
bool ffParseBreakJsonObject(FFinstance* instance, const char* type, FF_MAYBE_UNUSED JSONCData* data, FF_MAYBE_UNUSED json_object* module)
|
||||
{
|
||||
if (strcasecmp(type, FF_BREAK_MODULE_NAME) != 0)
|
||||
return false;
|
||||
|
||||
ffPrintBreak(instance);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "fastfetch.h"
|
||||
|
||||
void ffPrintBreak(FFinstance* instance);
|
||||
|
||||
#ifdef FF_HAVE_JSONC
|
||||
#include "common/config.h"
|
||||
bool ffParseBreakJsonObject(FFinstance* instance, const char* type, JSONCData* data, json_object* module);
|
||||
#endif
|
||||
@@ -17,6 +17,7 @@ static inline bool parseModuleJsonObject(FFinstance* instance, const char* type,
|
||||
ffParseBiosJsonObject(instance, type, data, module) ||
|
||||
ffParseBluetoothJsonObject(instance, type, data, module) ||
|
||||
ffParseBoardJsonObject(instance, type, data, module) ||
|
||||
ffParseBreakJsonObject(instance, type, data, module) ||
|
||||
ffParseCommandJsonObject(instance, type, data, module) ||
|
||||
ffParseDateTimeJsonObject(instance, type, data, module) ||
|
||||
ffParseDisplayJsonObject(instance, type, data, module) ||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "modules/bios/bios.h"
|
||||
#include "modules/bluetooth/bluetooth.h"
|
||||
#include "modules/board/board.h"
|
||||
#include "modules/break/break.h"
|
||||
#include "modules/command/command.h"
|
||||
#include "modules/datetime/datetime.h"
|
||||
#include "modules/display/display.h"
|
||||
|
||||
Reference in New Issue
Block a user