diff options
author | vaxerski <[email protected]> | 2023-07-10 14:13:23 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2023-07-10 14:13:23 +0200 |
commit | 0c61a1530f2da2571e8285df106b31af73843411 (patch) | |
tree | 5fc966f9e350d19a057a5a1268b03001ffc468f0 /example | |
parent | da7ea2b33d232ff54645b6de58663934e38eff67 (diff) | |
download | Hyprland-0c61a1530f2da2571e8285df106b31af73843411.tar.gz Hyprland-0c61a1530f2da2571e8285df106b31af73843411.zip |
plugins: fix config value usage in init
Diffstat (limited to 'example')
-rw-r--r-- | example/examplePlugin/main.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/example/examplePlugin/main.cpp b/example/examplePlugin/main.cpp index 589c99c0..560af387 100644 --- a/example/examplePlugin/main.cpp +++ b/example/examplePlugin/main.cpp @@ -77,8 +77,12 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) { static const auto METHODS = HyprlandAPI::findFunctionsByName(PHANDLE, "processMouseDownNormal"); g_pMouseDownHook = HyprlandAPI::createFunctionHook(PHANDLE, METHODS[0].address, (void*)&hkProcessMouseDownNormal); + static auto* const PBORDERCOLOR = HyprlandAPI::getConfigValue(PHANDLE, "plugin:example:border_color"); + // fancy notifications - HyprlandAPI::addNotificationV2(PHANDLE, {{"text", "Example hint"}, {"time", (uint64_t)10000}, {"color", CColor(0.2, 0.2, 0.9, 1.0)}, {"icon", ICON_HINT}}); + HyprlandAPI::addNotificationV2( + PHANDLE, + {{"text", "Example hint, color " + std::to_string(PBORDERCOLOR->intValue)}, {"time", (uint64_t)10000}, {"color", CColor{PBORDERCOLOR->intValue}}, {"icon", ICON_HINT}}); // Enable our hooks g_pFocusHook->hook(); |