diff --git a/README.md b/README.md index 45331b8..4eaa3c4 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,62 @@ You can use `hy3:makegroup` to create a new split. ## Installing ### Nix -Under nix, use the provided devShell, then go to [Manual Installation](#manual) +#### Using the home-manager module +Assuming you use hyprland's home manager module, you can easily integrate hy3, as hy3 provides a home manager module that exposes the `wayland.windowManager.hyprland.plugins.hy3.enable` option. + +```nix +# flake.nix + +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + hyprland.url = "github:hyprwm/Hyprland"; + + hy3 = { + url = "github:outfoxxed/hy3"; + inputs.hyprland.follows = "hyprland"; + }; + }; + + outputs = { nixpkgs, home-manager, hyprland, hy3, ... }: { + homeConfigurations."user@hostname" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + + modules = [ + hyprland.homeManagerModules.default + hy3.homeManagerModules.default + + { + wayland.windowManager.hyprland = { + enable = true; + plugins.hy3.enable = true; + }; + } + ]; + }; + }; +} +``` + +#### Manually (Nix) +hy3's binary is availible as `${hy3.packages..hy3}/lib/libhy3.so`, so you can also +directly use it in your hyprland config like so: + +```nix +# ... +wayland.windowManager.hyprland = { + # ... + extraConfig = '' + exec-once = hyprctl plugin load ${hy3.packages.x86_64-linux.hy3}/lib/libhy3.so + ''; +}; +``` ### [Hyprload](https://github.com/Duckonaut/hyprload) Add an entry to your hyprload.toml like so: @@ -49,19 +104,18 @@ Add an entry to your hyprload.toml like so: ```toml plugins = [ # ... - { git = "https://github.com/outfoxxed/hy3", branch = "master", name = "hy3" }, + "outfoxxed/hy3", # ... ] ``` ### Manual -First export `HYPRLAND_HEADERS`, then run the following commands: +Install hyprland, then run the following commands: ```sh cmake -DCMAKE_BUILD_TYPE=Debug -B build cmake --build build ``` -> **Note**: Please use a debug build as debugging a backtrace from a release build is much more difficult if you need to report an error. - -The plugin will be located at `build/libhy3.so`. +The plugin will be located at `build/libhy3.so`, and you can load it normally +(See [the hyprland wiki](https://wiki.hyprland.org/Plugins/Using-Plugins/#installing--using-plugins) for details.)