diff --git a/Makefile b/Makefile index 13f5215..6d2a077 100644 --- a/Makefile +++ b/Makefile @@ -14,15 +14,16 @@ install: all cp $(PLUGIN_NAME).so ${HOME}/.local/share/hyprload/plugins/bin check_env: -ifndef HYPRLAND_HEADERS - $(error HYPRLAND_HEADERS is undefined! Please set it to the path to the root of the configured Hyprland repo) -endif + @if ! pkg-config --exists hyprland; then \ + echo 'Hyprland headers not available. Run `make pluginenv` in the root Hyprland directory.'; \ + exit 1; \ + fi $(PLUGIN_NAME).so: $(SOURCE_FILES) $(INCLUDE_FILES) - g++ -shared -fPIC --no-gnu-unique $(SOURCE_FILES) -o $(PLUGIN_NAME).so -g -I "/usr/include/pixman-1" -I "/usr/include/libdrm" -I "${HYPRLAND_HEADERS}" -I "${HYPRLAND_HEADERS}/subprojects/wlroots/include" -I "${HYPRLAND_HEADERS}/subprojects/wlroots/build/include" -Iinclude -std=c++23 + g++ -shared -fPIC --no-gnu-unique $(SOURCE_FILES) -o $(PLUGIN_NAME).so -g `pkg-config --cflags pixman-1 libdrm hyprland` -Iinclude -std=c++23 clean: rm ./${PLUGIN_NAME}.so clangd: - printf "%b" "-I/usr/include/pixman-1\n-I/usr/include/libdrm\n-I${HYPRLAND_HEADERS}\n-Iinclude\n-std=c++2b" > compile_flags.txt + printf "%b" "`pkg-config --cflags pixman-1 libdrm hyprland | sed 's/ -/\n-/g'`\n-Iinclude\n-std=c++2b" > compile_flags.txt diff --git a/include/globals.hpp b/include/globals.hpp index 3b61032..66c4f04 100644 --- a/include/globals.hpp +++ b/include/globals.hpp @@ -1,5 +1,5 @@ #pragma once -#include +#include inline HANDLE PHANDLE = nullptr; diff --git a/src/main.cpp b/src/main.cpp index 7c3f845..7e93593 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,10 +2,10 @@ #include "globals.hpp" -#include -#include -#include -#include +#include +#include +#include +#include const CColor s_pluginColor = {0x61 / 255.0f, 0xAF / 255.0f, 0xEF / 255.0f, 1.0f};