feat: show commits when missmatched headers

This commit is contained in:
Virt 2024-07-06 19:38:35 +02:00
commit 85423b074e

View file

@ -11,6 +11,7 @@
#include "config/config.hpp" #include "config/config.hpp"
#include "src/debug/Log.hpp" #include "src/debug/Log.hpp"
#include "src/managers/PointerManager.hpp" #include "src/managers/PointerManager.hpp"
#include "src/version.h"
bool isEnabled() { bool isEnabled() {
static auto* const* PENABLED = (Hyprlang::INT* const*) getConfig(CONFIG_ENABLED); static auto* const* PENABLED = (Hyprlang::INT* const*) getConfig(CONFIG_ENABLED);
@ -93,6 +94,7 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
const std::string HASH = __hyprland_api_get_hash(); const std::string HASH = __hyprland_api_get_hash();
if (HASH != GIT_COMMIT_HASH) { if (HASH != GIT_COMMIT_HASH) {
HyprlandAPI::addNotification(PHANDLE, "[dynamic-cursors] Failed to load, mismatched headers!", CColor{1.0, 0.2, 0.2, 1.0}, 5000); HyprlandAPI::addNotification(PHANDLE, "[dynamic-cursors] Failed to load, mismatched headers!", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
HyprlandAPI::addNotification(PHANDLE, std::format("[dynamic-cursors] Built with: {}, running: {}", GIT_COMMIT_HASH, HASH), CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("version mismatch"); throw std::runtime_error("version mismatch");
} }