Plugin API: Add version query (#3545)
This commit is contained in:
parent
424c9a7e70
commit
d5a572bd39
2 changed files with 35 additions and 2 deletions
|
|
@ -277,7 +277,7 @@ APICALL std::vector<SFunctionMatch> HyprlandAPI::findFunctionsByName(HANDLE hand
|
|||
const auto FPATH = std::filesystem::canonical(exe);
|
||||
#elif defined(__OpenBSD__)
|
||||
// Neither KERN_PROC_PATHNAME nor /proc are supported
|
||||
const auto FPATH = std::filesystem::canonical("/usr/local/bin/Hyprland");
|
||||
const auto FPATH = std::filesystem::canonical("/usr/local/bin/Hyprland");
|
||||
#else
|
||||
const auto FPATH = std::filesystem::canonical("/proc/self/exe");
|
||||
#endif
|
||||
|
|
@ -338,3 +338,12 @@ APICALL std::vector<SFunctionMatch> HyprlandAPI::findFunctionsByName(HANDLE hand
|
|||
|
||||
return matches;
|
||||
}
|
||||
|
||||
APICALL SVersionInfo HyprlandAPI::getHyprlandVersion(HANDLE handle) {
|
||||
auto* const PLUGIN = g_pPluginSystem->getPluginByHandle(handle);
|
||||
|
||||
if (!PLUGIN)
|
||||
return {};
|
||||
|
||||
return {GIT_COMMIT_HASH, GIT_TAG, GIT_DIRTY != std::string(""), GIT_BRANCH, GIT_COMMIT_MESSAGE};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue