mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 16:26:39 +01:00
WMTheme (Haiku): implement
This commit is contained in:
committed by
Carter Li
parent
3043971259
commit
576548b15e
+1
-1
@@ -1257,7 +1257,7 @@ elseif(Haiku)
|
||||
src/detection/wifi/wifi_nosupport.c
|
||||
src/detection/wm/wm_nosupport.c
|
||||
src/detection/de/de_nosupport.c
|
||||
src/detection/wmtheme/wmtheme_nosupport.c
|
||||
src/detection/wmtheme/wmtheme_haiku.cpp
|
||||
src/detection/camera/camera_nosupport.c
|
||||
)
|
||||
elseif(GNU)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user