Hyprland plugin that overrides groupping behavior on dwindle layout to automatically group child nodes on creation
Go to file
ItsDrike c1c883a237
Replicate the new moveIntoGroup behavior
Hyprland has updated some of the core functions related to groupping
windows in PR: https://github.com/hyprwm/Hyprland/pull/2630

Specifically, the CWindow::insertWindowIntoGroup was updated to no
longer automatically make the newly inserted window the group's head,
allowing to insert windows without the group auto-focusing them.

With that, the CKeybindManager::moveIntoGroup (dispatcher) function was
then updated to adhere to the change in insertWindowIntoGroup and to
make the inserted widow the group's head from there.

It's probably possible to utilize the insertWindowIntoGroup without
making the inserted window the group's head in a more clever way,
however for now, this commit just changes our logic in groupCreate
function to fully replicate the moveIntoGroup for each dwindle child
node window.

This means we're still doing what we were doing before, that is to
insert a window, make it the group head, repeat for each dwindle child
and at the end make the original group head the head again.

The reason this fix doesn't simply skip making each of the nodes a group
head is that without it, the layout doesn't seem to properly recognize
that the window should no longer be shown, and while this probably can
be addressed by replicating some of the CWindow::setGroupCurrent
function's behavior, for now, that's a task for later.
2023-07-22 22:34:11 +02:00
include Move to pkg-config 2023-06-06 23:48:28 +02:00
src Replicate the new moveIntoGroup behavior 2023-07-22 22:34:11 +02:00
.clang-format Update clang-format 2023-03-31 15:48:55 +02:00
.gitignore Initial commit 2023-03-31 14:56:32 +02:00
hyprload.toml Initial commit 2023-03-31 14:56:32 +02:00
LICENSE Add license 2023-03-31 22:56:49 +02:00
Makefile Define WLR_USE_UNSTABLE in Makefile, not directly in main.cpp 2023-06-07 00:32:58 +02:00
README.md Update installation instructions after move to pkg-config 2023-06-07 00:14:36 +02:00

Dwindle-Autogroup

This plugin changes the behavior of the togglegroup dispatcher for dwindle layout, to automatically group all of the child windows when a new group is created.

Before Hyprland v0.23.0beta, this was actually the default behavior (PR #1580), however as that release introduced group support for other layouts, including floating windows, this dwindle specific feature was removed and togglegroup now only creates a group window, and requires you to move in all of the windows that should be a part of that group into it manually.

Installation

Since Hyprland plugins don't have ABI guarantees, you should download the Hyprland source and compile it if you plan to use plugins. This ensures the compiler version is the same between the Hyprland build you're running, and the plugins you are using.

The guide on compiling and installing Hyprland manually is on the wiki

Note, this plugin currently requires hyprland compiled from commit: 4afeedbd or later.

Using hyprload

Add the line "ItsDrike/hyprland-dwindle-autogroup" to your hyprload.toml config, like this:

plugins = [
    "ItsDrike/hyprland-dwindle-autogroup",
]

Then update via hyprload,update dispatcher.

Manual installation

  1. Clone the Hyprland repository and build the plugin environment

    • git clone --recursive https://github.com/hyprwm/Hyprland
    • In the Hyprland directory: make pluginenv
    • Ideally, you should use this instance of Hyprland as your compositor, to do that, run make install. This is heavily recommended, as using a different Hyprland instance might cause incompatibilities.
  2. Build the plugn

    • Run make all
  3. Add this line to the bottom of your hyprland config

    • exec-once=hyprctl plugin load <ABSOLUTE PATH TO split-monitor-workspaces.so>

Development

When developing, it is useful to run make clangd, to generate compile_flags.txt file, allowing Clang language server to properly recognize the imports, and give you autocompletion.

Disclaimer

I'm very new to C++ development, and I'm also not very familiar with Hyprland's codebase. So while I will do my best to follow best practices, with so little experience, you can be pretty much certain that there will be bugs, and that the code will not be pretty. But hey, if you know about something that I did wrong, feel free to PR/make an issue about it.