Skip to content

Commit

Permalink
Merge pull request #2 from vaxerski/main
Browse files Browse the repository at this point in the history
Update makefile + headers for current hyprland standards
  • Loading branch information
zakk4223 committed Jun 10, 2023
2 parents 087cc14 + e35d219 commit b727255
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 17 deletions.
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# compile with HYPRLAND_HEADERS=<path_to_hl> make all
# make sure that the path above is to the root hl repo directory, NOT src/
# and that you have ran `make protocols` in the hl dir.

all:
g++ -shared -Wall -fPIC --no-gnu-unique main.cpp nstackLayout.cpp -o nstackLayoutPlugin.so -g -I "/usr/include/pixman-1" -I "/usr/include/libdrm" -I "${HYPRLAND_HEADERS}" -std=c++23
$(CXX) -shared -fPIC --no-gnu-unique main.cpp nstackLayout.cpp -o nstackLayoutPlugin.so -g `pkg-config --cflags pixman-1 libdrm hyprland` -std=c++2b
clean:
rm ./nstackLayoutPlugin.so
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ Two new-ish orientations


# Installing
Hyprland plugins basically have to be user-compiled and loaded. You probably need to compile and install hyprland yourself (or install from something like the AUR on Arch).
Hyprland plugins basically have to be user-compiled and loaded. You probably need to compile and install hyprland yourself (if not using a package that exports the headers, e.g. the one on Arch's official repos).

Once you've done that, follow these steps.
If your package does not export headers, see the [this part of the hyprland wiki](https://wiki.hyprland.org/Plugins/Using-Plugins/#preparing-hyprland-sources-for-plugins)

1. Export the environment variable HYPRLAND_HEADERS and point it at the root of the Hyprland source
- `export HYPRLAND_HEADERS="$HOME/proj/Hyprland"`
2. Build hyprNStack
Then:

1. Build hyprNStack
- `make`
3. Copy the resulting nstackLayoutPlugin.so to some place
2. Copy the resulting nstackLayoutPlugin.so to some place
- `cp nstackLayoutPlugin.so ~/.config/hypr/plugins`
4. Modify your hyprland.conf to load the plugin
3. Modify your hyprland.conf to load the plugin
- `exec-once=hyprctl plugin load $HOME/.config/hypr/plugins/nstackLayoutPlugin.so`
5. Set your hyprland layout to `nstack`.
4. Set your hyprland layout to `nstack`.

# TODO
- [ ] Improve mouse resizing of stacks
Expand Down
2 changes: 1 addition & 1 deletion globals.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once

#include <src/plugins/PluginAPI.hpp>
#include <hyprland/src/plugins/PluginAPI.hpp>

inline HANDLE PHANDLE = nullptr;
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define WLR_USE_UNSTABLE

#include <src/config/ConfigManager.hpp>
#include <hyprland/src/config/ConfigManager.hpp>
#include "globals.hpp"

#include "nstackLayout.hpp"
Expand Down
2 changes: 1 addition & 1 deletion nstackLayout.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "nstackLayout.hpp"
#include <src/Compositor.hpp>
#include <hyprland/src/Compositor.hpp>

SNstackNodeData* CHyprNstackLayout::getNodeFromWindow(CWindow* pWindow) {
for (auto& nd : m_lMasterNodesData) {
Expand Down
2 changes: 1 addition & 1 deletion nstackLayout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define WLR_USE_UNSTABLE

#include "globals.hpp"
#include <src/layout/IHyprLayout.hpp>
#include <hyprland/src/layout/IHyprLayout.hpp>
#include <vector>
#include <list>
#include <deque>
Expand Down

0 comments on commit b727255

Please sign in to comment.