summaryrefslogtreecommitdiffstats
path: root/src/detection/wmtheme/wmtheme_haiku.cpp
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/detection/wmtheme/wmtheme_haiku.cpp
Add the files
Diffstat (limited to 'src/detection/wmtheme/wmtheme_haiku.cpp')
-rw-r--r--src/detection/wmtheme/wmtheme_haiku.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/detection/wmtheme/wmtheme_haiku.cpp b/src/detection/wmtheme/wmtheme_haiku.cpp
new file mode 100644
index 0000000..243eaa4
--- /dev/null
+++ b/src/detection/wmtheme/wmtheme_haiku.cpp
@@ -0,0 +1,30 @@
+extern "C" {
+#include "fastfetch.h"
+#include "wmtheme.h"
+}
+
+#include <Application.h>
+#include <private/interface/DecorInfo.h>
+
+bool ffDetectWmTheme(FFstrbuf* themeOrError)
+{
+ // We need a valid be_app to query the app_server here.
+ BApplication app("application/x-vnd.fastfetch-cli-fastfetch");
+
+ DecorInfoUtility *util = new DecorInfoUtility();
+ DecorInfo* decor = NULL;
+
+ if (util) {
+ decor = util->CurrentDecorator();
+ if (decor) {
+ ffStrbufAppendS(themeOrError, decor->Name().String());
+ }
+ delete util;
+ if (decor) {
+ return true;
+ }
+ }
+
+ ffStrbufAppendS(themeOrError, "Failed to get DecorInfo");
+ return false;
+}