summaryrefslogtreecommitdiffstats
path: root/src/common/settings.h
diff options
context:
space:
mode:
authorsumuel <samuel@yakubos.org>2026-08-17 20:44:55 +0000
committersumuel <samuel@yakubos.org>2026-08-17 20:44:55 +0000
commit76424950e373d3b04ac3dd13019151bfba3e8423 (patch)
tree4c3cfdbda039e592b9186be3e28f8d7cfd439e8a /src/common/settings.h
Add the files
Diffstat (limited to 'src/common/settings.h')
-rw-r--r--src/common/settings.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/common/settings.h b/src/common/settings.h
new file mode 100644
index 0000000..f2143cf
--- /dev/null
+++ b/src/common/settings.h
@@ -0,0 +1,47 @@
+#pragma once
+
+#include "fastfetch.h"
+
+typedef enum FF_A_PACKED FFvarianttype {
+ FF_VARIANT_TYPE_STRING,
+ FF_VARIANT_TYPE_BOOL,
+ FF_VARIANT_TYPE_INT
+} FFvarianttype;
+
+typedef union FFvariant {
+ const char* strValue;
+ int32_t intValue;
+ struct
+ {
+ bool boolValueSet;
+ bool boolValue;
+ };
+} FFvariant;
+
+#define FF_VARIANT_NULL ((FFvariant) { .strValue = NULL })
+
+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);
+
+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__
+bool ffSettingsGetAndroidProperty(const char* propName, FFstrbuf* result);
+#elif defined(__FreeBSD__)
+bool ffSettingsGetFreeBSDKenv(const char* propName, FFstrbuf* result);
+#endif