2f28dc810c0e1f42763a1f14fb011c4fce6db8be

Author
outfoxxed <outfoxxed@outfoxxed.me>
Committer
outfoxxed <outfoxxed@outfoxxed.me>
Date

Message

Rewrite installation instructions

Add hyprpm, deprecate AUR, prioritize stable releases for Nix.

Diff

  1diff --git a/README.md b/README.md
  2index 24f04f0dca069048250a850e1973e8a46eaa3630..54aed39b4ab48106e9218ab9e12f96e74eb658f7 100644
  3--- a/README.md
  4+++ b/README.md
  5@@ -65,12 +65,13 @@ Assuming you use hyprland's home manager module, you can easily integrate hy3 by
  6       inputs.nixpkgs.follows = "nixpkgs";
  7     };
  8 
  9-    hyprland.url = "github:hyprwm/Hyprland";
 10-    # or "github:hyprwm/Hyprland?ref=v{version}" for a release version of hyprland
 11+    hyprland.url = "github:hyprwm/Hyprland?ref=v{version}"; # where {version} is the hyprland release version
 12+    # or "github:hyprwm/Hyprland" to follow the development branch
 13 
 14     hy3 = {
 15-      url = "github:outfoxxed/hy3";
 16-      # or "github:outfoxxed/hy3?ref=hl{version}" for a release version of hyprland
 17+      url = "github:outfoxxed/hy3?ref=hl{version}"; # where {version} is the hyprland release version
 18+      # or "github:outfoxxed/hy3" to follow the development branch.
 19+      # (you may encounter issues if you dont do the same for hyprland)
 20       inputs.hyprland.follows = "hyprland";
 21     };
 22   };
 23@@ -108,11 +109,55 @@ wayland.windowManager.hyprland = {
 24 };
 25 ```
 26 
 27+### hyprpm
 28+Hyprland now has a dedicated plugin manager, which should be used when your package manager
 29+isn't capable of locking hy3 builds to the correct hyprland version.
 30+
 31+To install hy3 via hyprpm run
 32+
 33+```sh
 34+hyprpm add https://github.com/outfoxxed/hy3
 35+```
 36+
 37+To update hy3 (and all other plugins), run
 38+
 39+```sh
 40+hyprpm update
 41+```
 42+
 43+(See [the wiki](https://wiki.hyprland.org/Plugins/Using-Plugins/) for details.)
 44+
 45+> [!WARNING]
 46+> When you are running a tagged hyprland version hyprpm will build against hy3's
 47+> corrosponding release. However if you are running an untagged build (aka `-git`) hyprpm
 48+> will build against hy3's *latest* commit. This means **if you are running an out of date
 49+> untagged build of hyprland, hyprpm may pick an incompatible revision of hy3**.
 50+>
 51+> To fix this problem you will either need to update hyprland or manually build the correct
 52+> version of hy3.
 53+
 54+### Manual
 55+Install hyprland, including its headers and pkg-config file, then run the following commands:
 56+
 57+```sh
 58+cmake -DCMAKE_BUILD_TYPE=Release -B build
 59+cmake --build build
 60+```
 61+
 62+The plugin will be located at `build/libhy3.so`, and you can load it normally
 63+(See [the hyprland wiki](https://wiki.hyprland.org/Plugins/Using-Plugins/#installing--using-plugins) for details.)
 64+
 65+Note that the hyprland headers and pkg-config file **MUST be installed correctly, for the target version of hyprland**.
 66+
 67 ### Arch (AUR)
 68 
 69-> [!IMPORTANT]
 70+> [!NOTE]
 71+> This method of installation is deprecated and you should use *hyprpm* instead,
 72+> as it is simpler and less error prone.
 73+
 74+> [!CAUTION]
 75 > Pacman is not very reliable when it comes to building packages in the correct order.
 76-> If hy3 fails to load or build, crashes randomly or behaves oddly (commonly dispatchers stop working)
 77+> If you get a notification saying *hy3 was compiled for a different version of hyprland*
 78 > then your packages likely updated in the wrong order, or you have hyprland headers in `/usr/local`.
 79 >
 80 > To fix this, remove `/usr/include/hyprland`, `/usr/local/include/hyprland`, `/usr/share/pkgconfig/hyprland.pc` and `/usr/local/share/pkgconfig/hyprland.pc`,
 81@@ -131,19 +176,6 @@ You can enable it in your hyprland configuration by adding the following line an
 82 plugin = /usr/lib/libhy3.so
 83 ```
 84 
 85-### Manual
 86-Install hyprland, including its headers and pkg-config file, then run the following commands:
 87-
 88-```sh
 89-cmake -DCMAKE_BUILD_TYPE=Debug -B build
 90-cmake --build build
 91-```
 92-
 93-The plugin will be located at `build/libhy3.so`, and you can load it normally
 94-(See [the hyprland wiki](https://wiki.hyprland.org/Plugins/Using-Plugins/#installing--using-plugins) for details.)
 95-
 96-Note that the hyprland headers and pkg-config file **MUST be installed correctly, for the target version of hyprland**.
 97-
 98 ## Configuration
 99 
100 > [!IMPORTANT]
101diff --git a/compile_commands_bear.sh b/compile_commands_bear.sh
102index 83b49469823017e2efb8cc0bb341d43c5511a16b..246669388b432c5c7cb636799c1e1f008e94d44c 100755
103--- a/compile_commands_bear.sh
104+++ b/compile_commands_bear.sh
105@@ -1,4 +1,4 @@
106 rm -rf build
107-bear -- cmake --build build
108 cmake -DCMAKE_BUILD_TYPE=Debug -DHY3_NO_VERSION_CHECK=TRUE -B build
109+bear -- cmake --build build -j16
110 sed -i 's/-std=gnu++23/-std=gnu++2b/g' compile_commands.json
111diff --git a/hyprload.toml b/hyprload.toml
112index 0d3855c4a1b2554d5844ed74ab5328c0e60f667d..3ae0569f80ab35312f9a4fee5c8ec3c3a743fd04 100644
113--- a/hyprload.toml
114+++ b/hyprload.toml
115@@ -7,6 +7,6 @@ author = "outfoxxed"
116 output = "build/libhy3.so"
117 steps = [
118   "rm -rf build",
119-  "cmake -DCMAKE_BUILD_TYPE=Debug -B build",
120+  "cmake -DCMAKE_BUILD_TYPE=Release -B build",
121   "cmake --build build"
122 ]
123diff --git a/hyprpm.toml b/hyprpm.toml
124new file mode 100644
125index 0000000000000000000000000000000000000000..5ae6b8458a5e446ec30a97c4c3b2676084a38ed2
126--- /dev/null
127+++ b/hyprpm.toml
128@@ -0,0 +1,13 @@
129+[repository]
130+name = "hy3"
131+authors = ["outfoxxed"]
132+commit_pins = []
133+
134+[hy3]
135+description = "i3 like tiling for hyprland"
136+authors = ["outfoxxed"]
137+output = "build/libhy3.so"
138+build = [
139+	"cmake -DCMAKE_BUILD_TYPE=Release -B build",
140+	"cmake --build build"
141+]
142diff --git a/src/main.cpp b/src/main.cpp
143index aebe592e8ce28dee42d210d9d049dbeb62e4ff6e..249e14c98b1862dbbf08323e0b38d6a298b4c7d4 100644
144--- a/src/main.cpp
145+++ b/src/main.cpp
146@@ -18,7 +18,7 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
147 	if (GIT_COMMIT_HASH != std::string(__hyprland_api_get_hash())) {
148 		HyprlandAPI::addNotification(
149 		    PHANDLE,
150-		    "[hy3] Hy3 was compiled for a different version of hyprland; refusing to start.",
151+		    "[hy3] hy3 was compiled for a different version of hyprland; refusing to load.",
152 		    CColor {1.0, 0.2, 0.2, 1.0},
153 		    10000
154 		);