wip: support for new hyprpm

This commit is contained in:
Alessio Molinari 2023-12-10 10:49:02 +01:00
parent e0cb847660
commit c84e351b13
No known key found for this signature in database
4 changed files with 17 additions and 46 deletions

View File

@ -6,47 +6,18 @@ PLUGIN_NAME=virtual-desktops
SOURCE_FILES=$(wildcard src/*.cpp)
COMPILE_FLAGS=-g -fPIC --no-gnu-unique -std=c++23 -Wall
COMPILE_FLAGS+=-I "/usr/include/pixman-1"
COMPILE_FLAGS+=-I "/usr/include/libdrm"
COMPILE_FLAGS+=-I "${HYPRLAND_HEADERS}"
COMPILE_FLAGS+=-I "${HYPRLAND_HEADERS}/protocols"
COMPILE_FLAGS+=-I "${HYPRLAND_HEADERS}/subprojects/wlroots/include"
COMPILE_FLAGS+=-I "${HYPRLAND_HEADERS}/subprojects/wlroots/build/include"
COMPILE_FLAGS=-shared -g -fPIC --no-gnu-unique -std=c++23 -Wall
COMPILE_FLAGS+=-Iinclude
INCLUDES = `pkg-config --cflags pixman-1 libdrm hyprland`
COMPILE_DEFINES=-DWLR_USE_UNSTABLE
ifeq ($(shell whereis -b jq), "jq:")
$(error "jq not found. Please install jq.")
else
BUILT_WITH_NOXWAYLAND=$(shell hyprctl version -j | jq -r '.flags | .[]' | grep 'no xwayland')
ifneq ($(BUILT_WITH_NOXWAYLAND),)
COMPILE_DEFINES+=-DNO_XWAYLAND
endif
endif
.PHONY: clean clangd
all: check_env $(PLUGIN_NAME).so
install: all
cp $(PLUGIN_NAME).so ${HOME}/.local/share/hyprload/plugins/bin
check_env:
@if [ -z "${HYPRLAND_HEADERS}" ]; then \
echo "HYPRLAND_HEADERS not set. Please set it to the root of the hl repo directory."; \
exit 1; \
fi
all: $(PLUGIN_NAME).so
$(PLUGIN_NAME).so: $(SOURCE_FILES) $(INCLUDE_FILES)
g++ -shared $(COMPILE_FLAGS) $(COMPILE_DEFINES) $(SOURCE_FILES) -o $(PLUGIN_NAME).so
g++ -O2 $(COMPILE_FLAGS) $(INCLUDES) $(COMPILE_DEFINES) $(SOURCE_FILES) -o $(PLUGIN_NAME).so
debug: $(SOURCE_FILES) $(INCLUDE_FILES)
g++ -DDEBUG -shared $(COMPILE_FLAGS) $(COMPILE_DEFINES) $(SOURCE_FILES) -o $(PLUGIN_NAME).so
g++ -DDEBUG $(COMPILE_FLAGS) $(INCLUDES) $(COMPILE_DEFINES) $(SOURCE_FILES) -o $(PLUGIN_NAME).so
clean:
rm -f ./$(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

View File

@ -7,10 +7,10 @@
#include <unordered_map>
#include <unordered_set>
#include <src/helpers/Monitor.hpp>
#include <hyprland/helpers/Monitor.hpp>
#include "globals.hpp"
#include "utils.hpp"
#include <src/Compositor.hpp>
#include <hyprland/Compositor.hpp>
typedef std::unordered_map<int, int> WorkspaceMap;
typedef std::unordered_map<const CMonitor*, int> Layout;

View File

@ -3,11 +3,11 @@
#ifndef UTILS_H
#define UTILS_H
#include "src/debug/Log.hpp"
#include <hyprland/debug/Log.hpp>
#include "globals.hpp"
#include "src/config/ConfigManager.hpp"
#include <hyprland/config/ConfigManager.hpp>
#include <string>
#include "src/Compositor.hpp"
#include <hyprland/Compositor.hpp>
const std::string VIRTUALDESK_NAMES_CONF = "plugin:virtual-desktops:names";
const std::string CYCLEWORKSPACES_CONF = "plugin:virtual-desktops:cycleworkspaces";

View File

@ -1,10 +1,10 @@
#include <src/Compositor.hpp>
#include <src/config/ConfigManager.hpp>
#include <src/helpers/Color.hpp>
#include <src/helpers/MiscFunctions.hpp>
#include <src/helpers/Workspace.hpp>
#include <src/debug/Log.hpp>
#include <src/events/Events.hpp>
#include <hyprland/Compositor.hpp>
#include <hyprland/config/ConfigManager.hpp>
#include <hyprland/helpers/Color.hpp>
#include <hyprland/helpers/MiscFunctions.hpp>
#include <hyprland/helpers/Workspace.hpp>
#include <hyprland/debug/Log.hpp>
#include <hyprland/events/Events.hpp>
#include "globals.hpp"
#include "VirtualDeskManager.hpp"