Files
fastfetch/src/common/settings.h
T

48 lines
1.7 KiB
C
Raw Normal View History

#pragma once
#include "fastfetch.h"
2026-07-10 16:35:46 +08:00
typedef enum FFvarianttype: uint8_t {
FF_VARIANT_TYPE_STRING,
FF_VARIANT_TYPE_BOOL,
2026-07-10 16:35:46 +08:00
FF_VARIANT_TYPE_INT,
} FFvarianttype;
2026-03-29 09:28:49 +08:00
typedef union FFvariant {
const char* strValue;
int32_t intValue;
struct
{
bool boolValueSet;
bool boolValue;
};
} FFvariant;
2026-07-10 18:08:04 +08:00
#define FF_VARIANT_NULL ((FFvariant) { .strValue = nullptr })
FFvariant ffSettingsGetDConf(const char* key, FFvarianttype type);
FFvariant ffSettingsGetGSettings(const char* schemaName, const char* path, const char* key, FFvarianttype type);
FFvariant ffSettingsGetGnome(const char* dconfKey, const char* gsettingsSchemaName, const char* gsettingsPath, const char* gsettingsKey, FFvarianttype type);
FFvariant ffSettingsGetXFConf(const char* channelName, const char* propertyName, FFvarianttype type);
typedef bool FFTestXfconfPropCallback(void* data, const char* propertyName); // Return false to break loop
FFvariant ffSettingsGetXFConfFirstMatch(const char* channelName, const char* propertyPrefix, FFvarianttype type, void* data, FFTestXfconfPropCallback* cb);
int ffSettingsGetSQLite3Int(const char* dbPath, const char* query);
bool ffSettingsGetSQLite3String(const char* dbPath, const char* query, FFstrbuf* result);
2026-05-12 10:56:14 +08:00
typedef struct {
char* theme;
char* icon_theme;
bool use_e_cursor;
int cursor_size;
char* desktop_default_background;
char* font;
} ffEnlightenmentSettings;
bool ffSettingsGetEnlightenmentProperty(ffEnlightenmentSettings* result);
#ifdef __ANDROID__
2023-06-16 09:18:07 +08:00
bool ffSettingsGetAndroidProperty(const char* propName, FFstrbuf* result);
2023-06-15 10:03:12 +08:00
#elif defined(__FreeBSD__)
bool ffSettingsGetFreeBSDKenv(const char* propName, FFstrbuf* result);
#endif