Giter Site home page Giter Site logo

duckonaut / split-monitor-workspaces Goto Github PK

View Code? Open in Web Editor NEW
217.0 6.0 40.0 33 KB

A small Hyprland plugin to provide awesome-like workspace behavior

License: BSD 3-Clause "New" or "Revised" License

Makefile 8.87% C++ 74.09% Nix 11.25% Meson 5.80%
awesomewm hyprland workspace-management hyprland-plugin

split-monitor-workspaces's Introduction

split-monitor-workspaces

A small plugin to provide awesome/dwm-like behavior with workspaces: split them between monitors and provide independent numbering

Requirements

  • Hyprland >= v0.36.0

Installing

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

Using hyprpm

Hyprpm is a tool integrated with the latest Hyprland version, to use it first you'll need to add the repository and then enable the plugin

hyprpm add https://github.com/Duckonaut/split-monitor-workspaces # Add the plugin repository
hyprpm enable split-monitor-workspaces # Enable the plugin
hyprpm reload # Reload the plugins

Using hyprload

Add the line "Duckonaut/split-monitor-workspaces", to your hyprload.toml config, like this

plugins = [
    "Duckonaut/split-monitor-workspaces",
]

Then update via the hyprload,update dispatcher

Manual installation

  1. Export the HYPRLAND_HEADERS variable to point to the root directory of the Hyprland repo
    • export HYPRLAND_HEADERS="$HOME/repos/Hyprland"
  2. Compile
    • 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>

NixOS installation

With flakes enabled, a sample installation will look like this:

# 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";
    split-monitor-workspaces = {
      url = "github:Duckonaut/split-monitor-workspaces";
      inputs.hyprland.follows = "hyprland"; # <- make sure this line is present for the plugin to work as intended
    };
  };

  outputs = {
    self,
    nixpkgs,
    home-manager,
    split-monitor-workspaces,
    ...
  }: let
    system = "x86_64-linux";
    #        ↑ Swap it for your system if needed
    pkgs = nixpkgs.legacyPackages.${system};
  in {
    nixosConfigurations = {
      yourHostname = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          # ...
          home-manager.nixosModules.home-manager
          {
            home-manager = {
              useGlobalPkgs = true;
              useUserPackages = true;
              users.yourUsername = {
                wayland.windowManager.hyprland = {
                  # ...
                  plugins = [
                    split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces
                  ];
                  # ...
                };
              };
            };
          }
        ];
        # ...
      };
    };
  };
}

You will need to have home-manager installed and configured. You use wayland.windowManager.hyprland.plugins = []; to add the plugin. The home-manager module will handle the rest.

Usage

The plugin provides drop-in replacements for workspace-related commands

Normal Replacement
workspace split-workspace
movetoworkspace split-movetoworkspace
movetoworkspacesilent split-movetoworkspacesilent

And two new ones, to move windows between monitors

Normal Arguments
split-changemonitor next/prev/+1/1
split-changemonitorsilent next/prev/+1/1

It also provides the following config values

Name Type Default Description
plugin:split-monitor-workspaces:count int 10 How many workspaces to bind to the monitor
plugin:split-monitor-workspaces:keep_focused boolean 0 Keep current workspaces focused on plugin init/reload

Keep in mind that if you're using, for example, the wlr/workspaces widgets in waybar, this will require a change to your config. You should set all-outputs to false, and adjust the icon mapping.

If your workspace-per-monitor count is 10, the first monitor will have workspaces 1-10, the second 11-20 and so on. They will be accessed via numbers 1-10 while your mouse is on a given monitor.

Example

# in your hyprland config file:

plugin {
    split-monitor-workspaces {
        count = 5
    }
}

$mainMod = SUPER
# Switch workspaces with mainMod + [0-5]
bind = $mainMod, 1, split-workspace, 1
bind = $mainMod, 2, split-workspace, 2
bind = $mainMod, 3, split-workspace, 3
bind = $mainMod, 4, split-workspace, 4
bind = $mainMod, 5, split-workspace, 5

# Move active window to a workspace with mainMod + SHIFT + [0-5]
bind = $mainMod SHIFT, 1, split-movetoworkspacesilent, 1
bind = $mainMod SHIFT, 2, split-movetoworkspacesilent, 2
bind = $mainMod SHIFT, 3, split-movetoworkspacesilent, 3
bind = $mainMod SHIFT, 4, split-movetoworkspacesilent, 4
bind = $mainMod SHIFT, 5, split-movetoworkspacesilent, 5

Special thanks

  • hyprsome: An earlier project of similar nature

split-monitor-workspaces's People

Contributors

duckonaut avatar jeffser avatar kofteistkofte avatar notashelf avatar zjeffer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

split-monitor-workspaces's Issues

Failed to build with Hyprland 0.38.1

try to build commit b0ee3953eaeba70f3fba7c4368987d727779826a

[1/2] Compiling C++ object libsplit-monitor-workspaces.so.p/src_main.cpp.o
FAILED: libsplit-monitor-workspaces.so.p/src_main.cpp.o 
g++ -Ilibsplit-monitor-workspaces.so.p -I. -I.. -I../include -I/nix/store/pnx1hwlzpjpxrwsqfq1m0hc9kpykjacv-hyprland-0.38.1-dev/include -I/nix/store/pnx1hwlzpjpxrwsqfq1m0hc9kpykjacv-hyprland-0.38.1-dev/include/hyprland/protocols -I/nix/store/pnx1hwlzpjpxrwsqfq1m0hc9kpykjacv-hyprland-0.38.1-dev/include/hyprland/wlroots -I/nix/store/73lsxaii5sk9zgm7g53mca4a65a9i5xh-
pixman-0.43.4/include/pixman-1 -I/nix/store/njw23bh48h17f4mxb1zywv1gn89brz6r-libdrm-2.4.120-dev/include -I/nix/store/njw23bh48h17f4mxb1zywv1gn89brz6r-libdrm-2.4.120-dev/include/libdrm -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++23 -DWLR_USE_UNSTABLE -fPIC -MD -MQ libsplit-monitor-workspaces.so.p/src_main.cpp.o -MF libsplit-monito
r-workspaces.so.p/src_main.cpp.o.d -o libsplit-monitor-workspaces.so.p/src_main.cpp.o -c ../src/main.cpp
../src/main.cpp: In function 'void changeMonitor(bool, const std::string&)':
../src/main.cpp:99:55: error: base operand of '->' is not a pointer
   99 |     int nextWorkspaceID = nextMonitor->activeWorkspace->m_iID;
      |                                                       ^~
../src/main.cpp: In function 'void fixWorkspaceArrangement()':
../src/main.cpp:145:13: error: 'PHLWORKSPACE' was not declared in this scope
  145 |             PHLWORKSPACE workspacePtr = g_pCompositor->getWorkspaceByName(workspace);
      |             ^~~~~~~~~~~~
../src/main.cpp:146:17: error: 'workspacePtr' was not declared in this scope; did you mean 'workspace'?
  146 |             if (workspacePtr != nullptr) {
      |                 ^~~~~~~~~~~~
      |                 workspace
../src/main.cpp: In function 'void mapWorkspacesToMonitors()':
../src/main.cpp:198:13: error: 'PHLWORKSPACE' was not declared in this scope
  198 |             PHLWORKSPACE workspace = g_pCompositor->getWorkspaceByName(workspaceName);
      |             ^~~~~~~~~~~~
../src/main.cpp:200:17: error: 'workspace' was not declared in this scope; did you mean 'CWorkspace'?
  200 |             if (workspace != nullptr) {
      |                 ^~~~~~~~~
      |                 CWorkspace

Build failure aganist Hyprland f590505daf90dfb4059289a906863b59663e70a6 on NixOS

Output

error: builder for '/nix/store/75idw6vr1klhqz67ki3zs6pzrg0vnbs8-split-monitor-workspaces-0.1.drv' failed with exit code 1;
       last 10 log lines:
       > Running phase: buildPhase
       > build flags: -j16
       > [1/2] Compiling C++ object libsplit-monitor-workspaces.so.p/src_main.cpp.o
       > FAILED: libsplit-monitor-workspaces.so.p/src_main.cpp.o
       > g++ -Ilibsplit-monitor-workspaces.so.p -I. -I.. -I../include -I/nix/store/ivn3k9533as5kalgkwgnpj44c3p4w232-hyprland-0.36.0+date=2024-02-29_f590505-dev/include -I/nix/store/ivn3k9533as5kalgkwgnpj44c3p4w232-hyprland-0.36.0+date=2024-02-29_f590505-dev/include/hyprland/protocols -I/nix/store/ivn3k9533as5kalgkwgnpj44c3p4w232-hyprland-0.36.0+date=2024-02-29_f590505-dev/include/hyprland/wlroots -I/nix/store/mk3hpjywv0hkkn2bwplcb9lwvzsv2j0i-pixman-0.43.2/include/pixman-1 -I/nix/store/sg7sijswn5a2mb9ycjbir22mrbgib70n-libdrm-2.4.120-dev/include -I/nix/store/sg7sijswn5a2mb9ycjbir22mrbgib70n-libdrm-2.4.120-dev/include/libdrm -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++23 -DWLR_USE_UNSTABLE -fPIC -MD -MQ libsplit-monitor-workspaces.so.p/src_main.cpp.o -MF libsplit-monitor-workspaces.so.p/src_main.cpp.o.d -o libsplit-monitor-workspaces.so.p/src_main.cpp.o -c ../src/main.cpp
       > ../src/main.cpp:6:10: fatal error: hyprland/src/helpers/Workspace.hpp: No such file or directory
       >     6 | #include <hyprland/src/helpers/Workspace.hpp>
       >       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       > compilation terminated.
       > ninja: build stopped: subcommand failed.
       For full logs, run 'nix log /nix/store/75idw6vr1klhqz67ki3zs6pzrg0vnbs8-split-monitor-workspaces-0.1.drv'.
error: 1 dependencies of derivation '/nix/store/k3r89axw1v071jz16sg9kcdbm229q2nf-hm_hyprhyprland.conf.drv' failed to build
error: 1 dependencies of derivation '/nix/store/js74508dddahrz90gyfyc7471x8rvaaz-activation-script.drv' failed to build
error: 1 dependencies of derivation '/nix/store/jf62s6agh4iwwmyy507b4ma1d5rx3kvg-home-manager-generation.drv' failed to build
error: 1 dependencies of derivation '/nix/store/49iwsbk7jjyy8shw1l7j8bvnha01hrnh-unit-home-manager-noah.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/5dsvq3j1w9zr6pd5in2fr04wvagr2gd9-system-units.drv' failed to build
error: 1 dependencies of derivation '/nix/store/69910rvpsmpsp5v9i5jg1y0fb9k21afv-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/klz4ykv0r7fncbbmph1r2ga0lx4fwpyg-nixos-system-nixos-24.05.20240228.9099616.drv' failed to build

Full log

warning: The interpretation of store paths arguments ending in `.drv` recently changed. If this command is now failing try again with '/nix/store/75idw6vr1klhqz67ki3zs6pzrg0vnbs8-split-monitor-workspaces-0.1.drv^*'
@nix { "action": "setPhase", "phase": "unpackPhase" }
Running phase: unpackPhase
unpacking source archive /nix/store/bfvsaw766asr1zn15hbz65bgf7drpy13-source
source root is source
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
Running phase: configurePhase
mesonConfigurePhase flags: --prefix=/nix/store/kbym3pimvyn615czb5qp9cbj60qkl9f1-split-monitor-workspaces-0.1 --libdir=/nix/store/kbym3pimvyn615czb5qp9cbj60qkl9f1-split-monitor-workspaces>
The Meson build system
Version: 1.3.2
Source dir: /build/source
Build dir: /build/source/build
Build type: native build
Project name: split-monitor-workspaces
Project version: 0.1
C++ compiler for the host machine: g++ (gcc 13.2.0 "g++ (GCC) 13.2.0")
C++ linker for the host machine: g++ ld.bfd 2.40
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C++ supports arguments -std=c++23: YES
meson.build:8: WARNING: Consider using the built-in option for language standard version instead of using "-std=c++23".
Found pkg-config: YES (/nix/store/492n7ylp2f9zn0k3vghv1snypgkzznc5-pkg-config-wrapper-0.29.2/bin/pkg-config) 0.29.2
Run-time dependency hyprland found: YES 0.36.0
Run-time dependency pixman-1 found: YES 0.43.2
Run-time dependency libdrm found: YES 2.4.120
Build targets in project: 1

split-monitor-workspaces 0.1

  User defined options
    auto_features: enabled
    bindir       : /nix/store/kbym3pimvyn615czb5qp9cbj60qkl9f1-split-monitor-workspaces-0.1/bin
    buildtype    : plain
    includedir   : /nix/store/kbym3pimvyn615czb5qp9cbj60qkl9f1-split-monitor-workspaces-0.1/include
    infodir      : /nix/store/kbym3pimvyn615czb5qp9cbj60qkl9f1-split-monitor-workspaces-0.1/share/info
    libdir       : /nix/store/kbym3pimvyn615czb5qp9cbj60qkl9f1-split-monitor-workspaces-0.1/lib
    libexecdir   : /nix/store/kbym3pimvyn615czb5qp9cbj60qkl9f1-split-monitor-workspaces-0.1/libexec
    localedir    : /nix/store/kbym3pimvyn615czb5qp9cbj60qkl9f1-split-monitor-workspaces-0.1/share/locale
    mandir       : /nix/store/kbym3pimvyn615czb5qp9cbj60qkl9f1-split-monitor-workspaces-0.1/share/man
    prefix       : /nix/store/kbym3pimvyn615czb5qp9cbj60qkl9f1-split-monitor-workspaces-0.1
    sbindir      : /nix/store/kbym3pimvyn615czb5qp9cbj60qkl9f1-split-monitor-workspaces-0.1/sbin
    wrap_mode    : nodownload

Found ninja-1.11.1 at /nix/store/3dj1s1bhxanq3f0nffwf786l71g1lcn6-ninja-1.11.1/bin/ninja
mesonConfigurePhase: enabled\ parallel\ building
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: buildPhase
build flags: -j16
[1/2] Compiling C++ object libsplit-monitor-workspaces.so.p/src_main.cpp.o
FAILED: libsplit-monitor-workspaces.so.p/src_main.cpp.o
g++ -Ilibsplit-monitor-workspaces.so.p -I. -I.. -I../include -I/nix/store/ivn3k9533as5kalgkwgnpj44c3p4w232-hyprland-0.36.0+date=2024-02-29_f590505-dev/include -I/nix/store/ivn3k9533as5ka>
../src/main.cpp:6:10: fatal error: hyprland/src/helpers/Workspace.hpp: No such file or directory
    6 | #include <hyprland/src/helpers/Workspace.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.

Flake.lock

{
  "nodes": {
    "home-manager": {
      "inputs": {
        "nixpkgs": [
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1709204054,
        "narHash": "sha256-U1idK0JHs1XOfSI1APYuXi4AEADf+B+ZU4Wifc0pBHk=",
        "owner": "nix-community",
        "repo": "home-manager",
        "rev": "2f3367769a93b226c467551315e9e270c3f78b15",
        "type": "github"
      },
      "original": {
        "owner": "nix-community",
        "repo": "home-manager",
        "type": "github"
      }
    },
    "hyprland": {
      "inputs": {
        "hyprland-protocols": "hyprland-protocols",
        "hyprlang": "hyprlang",
        "nixpkgs": "nixpkgs",
        "systems": "systems",
        "wlroots": "wlroots",
        "xdph": "xdph"
      },
      "locked": {
        "lastModified": 1709243510,
        "narHash": "sha256-e47KWaUGQc+JLUABYdG0eCeqY1fFf1xGvakpKcdOP9c=",
        "owner": "hyprwm",
        "repo": "Hyprland",
        "rev": "f590505daf90dfb4059289a906863b59663e70a6",
        "type": "github"
      },
      "original": {
        "owner": "hyprwm",
        "repo": "Hyprland",
        "type": "github"
      }
    },
    "hyprland-protocols": {
      "inputs": {
        "nixpkgs": [
          "hyprland",
          "nixpkgs"
        ],
        "systems": [
          "hyprland",
          "systems"
        ]
      },
      "locked": {
        "lastModified": 1691753796,
        "narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=",
        "owner": "hyprwm",
        "repo": "hyprland-protocols",
        "rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03",
        "type": "github"
      },
      "original": {
        "owner": "hyprwm",
        "repo": "hyprland-protocols",
        "type": "github"
      }
    },
    "hyprlang": {
      "inputs": {
        "nixpkgs": [
          "hyprland",
          "nixpkgs"
        ],
        "systems": [
          "hyprland",
          "systems"
        ]
      },
      "locked": {
        "lastModified": 1708787654,
        "narHash": "sha256-7ACgM3ZuAhPqurXHUvR2nWMRcnmzGGPjLK6q4DSTelI=",
        "owner": "hyprwm",
        "repo": "hyprlang",
        "rev": "0fce791ba2334aca183f2ed42399518947550d0d",
        "type": "github"
      },
      "original": {
        "owner": "hyprwm",
        "repo": "hyprlang",
        "type": "github"
      }
    },
    "nix-filter": {
      "locked": {
        "lastModified": 1693833173,
        "narHash": "sha256-hlMABKrGbEiJD5dwUSfnw1CQ3bG7KKwDV+Nx3bEZd7U=",
        "owner": "numtide",
        "repo": "nix-filter",
        "rev": "ac030bd9ba98e318e1f4c4328d60766ade8ebe8b",
        "type": "github"
      },
      "original": {
        "owner": "numtide",
        "repo": "nix-filter",
        "type": "github"
      }
    },
    "nixpkgs": {
      "locked": {
        "lastModified": 1708807242,
        "narHash": "sha256-sRTRkhMD4delO/hPxxi+XwLqPn8BuUq6nnj4JqLwOu0=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "73de017ef2d18a04ac4bfd0c02650007ccb31c2a",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "nixos-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "nixpkgs_2": {
      "locked": {
        "lastModified": 1709150264,
        "narHash": "sha256-HofykKuisObPUfj0E9CJVfaMhawXkYx3G8UIFR/XQ38=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "9099616b93301d5cf84274b184a3a5ec69e94e08",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "nixos-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "nur": {
      "locked": {
        "lastModified": 1709248623,
        "narHash": "sha256-Zmo187XIeCGlGHRcczf5tboirJghYesHmX2Eug8CQRY=",
        "owner": "nix-community",
        "repo": "NUR",
        "rev": "14de3286e2081dbffaa7ebb595363227b6af2a74",
        "type": "github"
      },
      "original": {
        "owner": "nix-community",
        "repo": "NUR",
        "type": "github"
      }
    },
    "root": {
      "inputs": {
        "home-manager": "home-manager",
        "hyprland": "hyprland",
        "nixpkgs": "nixpkgs_2",
        "nur": "nur",
        "split-monitor-workspaces": "split-monitor-workspaces"
      }
    },
    "split-monitor-workspaces": {
      "inputs": {
        "hyprland": [
          "hyprland"
        ],
        "nix-filter": "nix-filter"
      },
      "locked": {
        "lastModified": 1709119202,
        "narHash": "sha256-3qcLLe+LqC1YAdqpKtU1COlxzb5uqpTMYgwmleS2oRg=",
        "owner": "Duckonaut",
        "repo": "split-monitor-workspaces",
        "rev": "d0012b8b0f764e32dd7b82f7a94b8c30197d7dc8",
        "type": "github"
      },
      "original": {
        "owner": "Duckonaut",
        "repo": "split-monitor-workspaces",
        "type": "github"
      }
    },
    "systems": {
      "locked": {
        "lastModified": 1689347949,
        "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
        "owner": "nix-systems",
        "repo": "default-linux",
        "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
        "type": "github"
      },
      "original": {
        "owner": "nix-systems",
        "repo": "default-linux",
        "type": "github"
      }
    },
    "wlroots": {
      "flake": false,
      "locked": {
        "host": "gitlab.freedesktop.org",
        "lastModified": 1708558866,
        "narHash": "sha256-Mz6hCtommq7RQfcPnxLINigO4RYSNt23HeJHC6mVmWI=",
        "owner": "wlroots",
        "repo": "wlroots",
        "rev": "0cb091f1a2d345f37d2ee445f4ffd04f7f4ec9e5",
        "type": "gitlab"
      },
      "original": {
        "host": "gitlab.freedesktop.org",
        "owner": "wlroots",
        "repo": "wlroots",
        "rev": "0cb091f1a2d345f37d2ee445f4ffd04f7f4ec9e5",
        "type": "gitlab"
      }
    },
    "xdph": {
      "inputs": {
        "hyprland-protocols": [
          "hyprland",
          "hyprland-protocols"
        ],
        "hyprlang": [
          "hyprland",
          "hyprlang"
        ],
        "nixpkgs": [
          "hyprland",
          "nixpkgs"
        ],
        "systems": [
          "hyprland",
          "systems"
        ]
      },
      "locked": {
        "lastModified": 1708696469,
        "narHash": "sha256-shh5wmpeYy3MmsBfkm4f76yPsBDGk6OLYRVG+ARy2F0=",
        "owner": "hyprwm",
        "repo": "xdg-desktop-portal-hyprland",
        "rev": "1b713911c2f12b96c2574474686e4027ac4bf826",
        "type": "github"
      },
      "original": {
        "owner": "hyprwm",
        "repo": "xdg-desktop-portal-hyprland",
        "type": "github"
      }
    }
  },
  "root": "root",
  "version": 7
}

Invalid dispatcher

I think I have installed hyprload correctly, the keybinds work for updating, installing, reloading etc.

I have added split-monitor-workspaces to hyprload.toml etc.

However when I go to hyprland.conf to edit the dispatchers from "workspace" to "split-workspace", hyprland complains about it being an invalid dispatcher. What could I be doing wrong?

Error when updating with hyprload

I just installed hyprland-git from the AUR package, and hyprload following the instructions, however it seems to fail when i do the hyprload update command.

Failed to update split monitor workspaces failed to build plugin:g++ -shared -fpic --no-gnu-unique src/main.cpp -o split-monitor-workspaces.so -g -I "/usr/include/pixman-1" -I "/usr/include/libdrm" -I "/home/user/.local/share/hyprload/hyprland" -Iinclude -std=c++23[]

Where to set the config value?

I've tried setting it in hyprland.conf at plugins

plugin {
  hyperload {
    config = "~/.config/hypr/hyprload.toml"
  },
  split-monitor-workspaces {
    count: 5,
  }
}

as well as in hyprload.toml

[split-monitor-workspaces]
count = 5

but none of these methods work

License

Hello,

I packaged your plugin for Gentoo, and I noticed that your plugin doesn't have a license. If would be nice to have one. The official plugins use the BSD license

Since I packaged your plugin in the same package as the official plugins, I used the BSD license. Let me know if tihs is incorrect and I will change it.

Share sample config file

I was wondering if someone who uses this on multi-monitor setup would share their config file here.

Crashes Hyprland when having more than 2 monitors

Since some recent Hyprland commit (like 2 days ago but I didn't check which one exactly sorry), I'm unable to start Hyprland with more than 2 monitors if this plugin is enabled.

Here's a coredump example

``` PID: 1440913 (Hyprland) UID: 1000 (gwen) GID: 100 (users) Signal: 11 (SEGV) Timestamp: Thu 2024-03-14 15:08:23 CET (19min ago) Command Line: Hyprland Executable: /nix/store/6fv2wn1rl6licpcqbjd39a9h9kazx03m-hyprland-0.36.0+date=2024-03-13_3e67ee0/bin/Hyprland Control Group: /user.slice/user-1000.slice/session-11.scope Unit: session-11.scope Slice: user-1000.slice Session: 11 Owner UID: 1000 (gwen) Boot ID: 0870611c9b204acab7f2fed31a1f4483 Machine ID: e50442db879644489a80afda252187a7 Hostname: thinkpad Storage: /var/lib/systemd/coredump/core.Hyprland.1000.0870611c9b204acab7f2fed31a1f4483.1440913.1710425303000000.zst (present) Size on Disk: 4.1M Message: Process 1440913 (Hyprland) of user 1000 dumped core.
            Module libsplit-monitor-workspaces.so without build-id.
            Module libpciaccess.so.0 without build-id.
            Module liblzma.so.5 without build-id.
            Module libncursesw.so.6 without build-id.
            Module libdrm_intel.so.1 without build-id.
            Module libdrm_nouveau.so.2 without build-id.
            Module libdrm_amdgpu.so.1 without build-id.
            Module libdrm_radeon.so.1 without build-id.
            Module libsensors.so.5 without build-id.
            Module libzstd.so.1 without build-id.
            Module libxshmfence.so.1 without build-id.
            Module libxcb-sync.so.1 without build-id.
            Module libxcb-dri2.so.0 without build-id.
            Module libX11-xcb.so.1 without build-id.
            Module libbrotlicommon.so.1 without build-id.
            Module libgraphite2.so.3 without build-id.
            Module libdatrie.so.1 without build-id.
            Module libgudev-1.0.so.0 without build-id.
            Module libpcre2-8.so.0 without build-id.
            Module libjpeg.so.62 without build-id.
            Module libselinux.so.1 without build-id.
            Module libxml2.so.2 without build-id.
            Module libbrotlidec.so.1 without build-id.
            Module libbz2.so.1 without build-id.
            Module libxcb-randr.so.0 without build-id.
            Module libexpat.so.1 without build-id.
            Module libpangoft2-1.0.so.0 without build-id.
            Module libharfbuzz.so.0 without build-id.
            Module libthai.so.0 without build-id.
            Module libfribidi.so.0 without build-id.
            Module libGLX.so.0 without build-id.
            Module libcap.so.2 without build-id.
            Module libXdmcp.so.6 without build-id.
            Module libXau.so.6 without build-id.
            Module libwacom.so.9 without build-id.
            Module libevdev.so.2 without build-id.
            Module libmtdev.so.1 without build-id.
            Module libGLdispatch.so.0 without build-id.
            Module librsvg-2.so.2 without build-id.
            Module libzip.so.5 without build-id.
            Module libXrender.so.1 without build-id.
            Module libXext.so.6 without build-id.
            Module libX11.so.6 without build-id.
            Module libfreetype.so.6 without build-id.
            Module libfontconfig.so.1 without build-id.
            Module libpng16.so.16 without build-id.
            Module libz.so.1 without build-id.
            Module libxcb-errors.so.0 without build-id.
            Module libxcb-res.so.0 without build-id.
            Module libxcb-icccm.so.4 without build-id.
            Module libxcb-ewmh.so.2 without build-id.
            Module libxcb-composite.so.0 without build-id.
            Module libxcb-xinput.so.0 without build-id.
            Module libxcb-xfixes.so.0 without build-id.
            Module libxcb-shm.so.0 without build-id.
            Module libxcb-render-util.so.0 without build-id.
            Module libxcb-render.so.0 without build-id.
            Module libxcb-present.so.0 without build-id.
            Module libxcb-dri3.so.0 without build-id.
            Module libliftoff.so.0 without build-id.
            Module libdisplay-info.so.1 without build-id.
            Module libseat.so.1 without build-id.
            Module libudev.so.1 without build-id.
            Module libvulkan.so.1 without build-id.
            Module libGLESv2.so.2 without build-id.
            Module libffi.so.8 without build-id.
            Module libgcc_s.so.1 without build-id.
            Module libstdc++.so.6 without build-id.
            Module libpangocairo-1.0.so.0 without build-id.
            Module libpango-1.0.so.0 without build-id.
            Module libGL.so.1 without build-id.
            Module libudis86.so.0 without build-id.
            Module libsystemd.so.0 without build-id.
            Module libxcb.so.1 without build-id.
            Module libinput.so.10 without build-id.
            Module libxkbcommon.so.0 without build-id.
            Module libEGL.so.1 without build-id.
            Module libdrm.so.2 without build-id.
            Module libhyprlang.so.2 without build-id.
            Module libhyprcursor.so.0 without build-id.
            Module libwlroots.so.13 without build-id.
            Module Hyprland without build-id.
            Stack trace of thread 1440913:
            #0  0x00007f9d201f49f0 _Z23mapWorkspacesToMonitorsv (libsplit-monitor-workspaces.so + 0xf9f0)
            #1  0x00007f9d201f61a3 pluginInit (libsplit-monitor-workspaces.so + 0x111a3)
            #2  0x000000000063475f _ZN13CPluginSystem10loadPluginERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE (Hyprland + 0x23475f)
            #3  0x000000000063553f _ZN13CPluginSystem19updateConfigPluginsERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS6_EERb (Hyprland + 0x23553f)
            #4  0x000000000051ded0 _ZN14CConfigManager17handlePluginLoadsEv (Hyprland + 0x11ded0)
            #5  0x000000000051d34c _ZN14CConfigManager16postConfigReloadERKN8Hyprlang12CParseResultE (Hyprland + 0x11d34c)
            #6  0x000000000051da18 _ZN14CConfigManager6reloadEv (Hyprland + 0x11da18)
            #7  0x000000000051dcb5 _ZN14CConfigManager4tickEv (Hyprland + 0x11dcb5)
            #8  0x00000000005fd3fb _Z11handleTimerPv (Hyprland + 0x1fd3fb)
            #9  0x00007f9d3328caef wl_event_loop_dispatch (libwayland-server.so.0 + 0xbaef)
            #10 0x00007f9d3328a455 wl_display_run (libwayland-server.so.0 + 0x9455)
            #11 0x00000000004943b2 main (Hyprland + 0x943b2)
            #12 0x00007f9d3255d0ce __libc_start_call_main (libc.so.6 + 0x280ce)
            #13 0x00007f9d3255d189 __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x28189)
            #14 0x00000000004aab45 _start (Hyprland + 0xaab45)
            
            Stack trace of thread 1440921:
            #0  0x00007f9d325bcebe __futex_abstimed_wait_common (libc.so.6 + 0x87ebe)
            #1  0x00007f9d325bf720 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8a720)
            #2  0x00007f9d29f17b19 cnd_wait (radeonsi_dri.so + 0x117b19)
            #3  0x00007f9d29ef7edb util_queue_thread_func (radeonsi_dri.so + 0xf7edb)
            #4  0x00007f9d29f17a57 impl_thrd_routine (radeonsi_dri.so + 0x117a57)
            #5  0x00007f9d325c0383 start_thread (libc.so.6 + 0x8b383)
            #6  0x00007f9d3264300c __clone3 (libc.so.6 + 0x10e00c)
            
            Stack trace of thread 1440918:
            #0  0x00007f9d325bcebe __futex_abstimed_wait_common (libc.so.6 + 0x87ebe)
            #1  0x00007f9d325bf720 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8a720)
            #2  0x00000000005adbfd _ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJZN9CWatchdogC4EvEUlvE_EEEEE6_M_runEv (Hyprland + 0x1adbfd)
            #3  0x00007f9d328e8683 execute_native_thread_routine (libstdc++.so.6 + 0xe8683)
            #4  0x00007f9d325c0383 start_thread (libc.so.6 + 0x8b383)
            #5  0x00007f9d3264300c __clone3 (libc.so.6 + 0x10e00c)
            
            Stack trace of thread 1440920:
            #0  0x00007f9d325bcebe __futex_abstimed_wait_common (libc.so.6 + 0x87ebe)
            #1  0x00007f9d325bf720 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8a720)
            #2  0x00007f9d29f17b19 cnd_wait (radeonsi_dri.so + 0x117b19)
            #3  0x00007f9d29ef7edb util_queue_thread_func (radeonsi_dri.so + 0xf7edb)
            #4  0x00007f9d29f17a57 impl_thrd_routine (radeonsi_dri.so + 0x117a57)
            #5  0x00007f9d325c0383 start_thread (libc.so.6 + 0x8b383)
            #6  0x00007f9d3264300c __clone3 (libc.so.6 + 0x10e00c)
            
            Stack trace of thread 1440922:
            #0  0x00007f9d325bcebe __futex_abstimed_wait_common (libc.so.6 + 0x87ebe)
            #1  0x00007f9d325bf720 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8a720)
            #2  0x00007f9d29f17b19 cnd_wait (radeonsi_dri.so + 0x117b19)
            #3  0x00007f9d29ef7edb util_queue_thread_func (radeonsi_dri.so + 0xf7edb)
            #4  0x00007f9d29f17a57 impl_thrd_routine (radeonsi_dri.so + 0x117a57)
            #5  0x00007f9d325c0383 start_thread (libc.so.6 + 0x8b383)
            #6  0x00007f9d3264300c __clone3 (libc.so.6 + 0x10e00c)
            
            Stack trace of thread 1440923:
            #0  0x00007f9d325bcebe __futex_abstimed_wait_common (libc.so.6 + 0x87ebe)
            #1  0x00007f9d325bf720 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8a720)
            #2  0x00007f9d29f17b19 cnd_wait (radeonsi_dri.so + 0x117b19)
            #3  0x00007f9d29ef7edb util_queue_thread_func (radeonsi_dri.so + 0xf7edb)
            #4  0x00007f9d29f17a57 impl_thrd_routine (radeonsi_dri.so + 0x117a57)
            #5  0x00007f9d325c0383 start_thread (libc.so.6 + 0x8b383)
            #6  0x00007f9d3264300c __clone3 (libc.so.6 + 0x10e00c)
            
            Stack trace of thread 1440924:
            #0  0x00007f9d325bcebe __futex_abstimed_wait_common (libc.so.6 + 0x87ebe)
            #1  0x00007f9d325bf720 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8a720)
            #2  0x00007f9d29f17b19 cnd_wait (radeonsi_dri.so + 0x117b19)
            #3  0x00007f9d29ef7edb util_queue_thread_func (radeonsi_dri.so + 0xf7edb)
            #4  0x00007f9d29f17a57 impl_thrd_routine (radeonsi_dri.so + 0x117a57)
            #5  0x00007f9d325c0383 start_thread (libc.so.6 + 0x8b383)
            #6  0x00007f9d3264300c __clone3 (libc.so.6 + 0x10e00c)
            
            Stack trace of thread 1440926:
            #0  0x00007f9d325bcebe __futex_abstimed_wait_common (libc.so.6 + 0x87ebe)
            #1  0x00007f9d325bf720 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8a720)
            #2  0x00007f9d29f17b19 cnd_wait (radeonsi_dri.so + 0x117b19)
            #3  0x00007f9d29ef7edb util_queue_thread_func (radeonsi_dri.so + 0xf7edb)
            #4  0x00007f9d29f17a57 impl_thrd_routine (radeonsi_dri.so + 0x117a57)
            #5  0x00007f9d325c0383 start_thread (libc.so.6 + 0x8b383)
            #6  0x00007f9d3264300c __clone3 (libc.so.6 + 0x10e00c)
            
            Stack trace of thread 1440925:
            #0  0x00007f9d325bcebe __futex_abstimed_wait_common (libc.so.6 + 0x87ebe)
            #1  0x00007f9d325bf720 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8a720)
            #2  0x00007f9d29f17b19 cnd_wait (radeonsi_dri.so + 0x117b19)
            #3  0x00007f9d29ef7edb util_queue_thread_func (radeonsi_dri.so + 0xf7edb)
            #4  0x00007f9d29f17a57 impl_thrd_routine (radeonsi_dri.so + 0x117a57)
            #5  0x00007f9d325c0383 start_thread (libc.so.6 + 0x8b383)
            #6  0x00007f9d3264300c __clone3 (libc.so.6 + 0x10e00c)
            
            Stack trace of thread 1440928:
            #0  0x00007f9d325bcebe __futex_abstimed_wait_common (libc.so.6 + 0x87ebe)
            #1  0x00007f9d325bf720 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8a720)
            #2  0x00007f9d29f17b19 cnd_wait (radeonsi_dri.so + 0x117b19)
            #3  0x00007f9d29ef7edb util_queue_thread_func (radeonsi_dri.so + 0xf7edb)
            #4  0x00007f9d29f17a57 impl_thrd_routine (radeonsi_dri.so + 0x117a57)
            #5  0x00007f9d325c0383 start_thread (libc.so.6 + 0x8b383)
            #6  0x00007f9d3264300c __clone3 (libc.so.6 + 0x10e00c)
            
            Stack trace of thread 1440927:
            #0  0x00007f9d325bcebe __futex_abstimed_wait_common (libc.so.6 + 0x87ebe)
            #1  0x00007f9d325bf720 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8a720)
            #2  0x00007f9d29f17b19 cnd_wait (radeonsi_dri.so + 0x117b19)
            #3  0x00007f9d29ef7edb util_queue_thread_func (radeonsi_dri.so + 0xf7edb)
            #4  0x00007f9d29f17a57 impl_thrd_routine (radeonsi_dri.so + 0x117a57)
            #5  0x00007f9d325c0383 start_thread (libc.so.6 + 0x8b383)
            #6  0x00007f9d3264300c __clone3 (libc.so.6 + 0x10e00c)
            
            Stack trace of thread 1440931:
            #0  0x00007f9d325bcebe __futex_abstimed_wait_common (libc.so.6 + 0x87ebe)
            #1  0x00007f9d325bf720 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8a720)
            #2  0x00007f9d29f17b19 cnd_wait (radeonsi_dri.so + 0x117b19)
            #3  0x00007f9d29ef7edb util_queue_thread_func (radeonsi_dri.so + 0xf7edb)
            #4  0x00007f9d29f17a57 impl_thrd_routine (radeonsi_dri.so + 0x117a57)
            #5  0x00007f9d325c0383 start_thread (libc.so.6 + 0x8b383)
            #6  0x00007f9d3264300c __clone3 (libc.so.6 + 0x10e00c)
            
            Stack trace of thread 1440930:
            #0  0x00007f9d325bcebe __futex_abstimed_wait_common (libc.so.6 + 0x87ebe)
            #1  0x00007f9d325bf720 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8a720)
            #2  0x00007f9d29f17b19 cnd_wait (radeonsi_dri.so + 0x117b19)
            #3  0x00007f9d29ef7edb util_queue_thread_func (radeonsi_dri.so + 0xf7edb)
            #4  0x00007f9d29f17a57 impl_thrd_routine (radeonsi_dri.so + 0x117a57)
            #5  0x00007f9d325c0383 start_thread (libc.so.6 + 0x8b383)
            #6  0x00007f9d3264300c __clone3 (libc.so.6 + 0x10e00c)
            
            Stack trace of thread 1440929:
            #0  0x00007f9d325bcebe __futex_abstimed_wait_common (libc.so.6 + 0x87ebe)
            #1  0x00007f9d325bf720 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8a720)
            #2  0x00007f9d29f17b19 cnd_wait (radeonsi_dri.so + 0x117b19)
            #3  0x00007f9d29ef7edb util_queue_thread_func (radeonsi_dri.so + 0xf7edb)
            #4  0x00007f9d29f17a57 impl_thrd_routine (radeonsi_dri.so + 0x117a57)
            #5  0x00007f9d325c0383 start_thread (libc.so.6 + 0x8b383)
            #6  0x00007f9d3264300c __clone3 (libc.so.6 + 0x10e00c)
            
            Stack trace of thread 1440934:
            #0  0x00007f9d325bcebe __futex_abstimed_wait_common (libc.so.6 + 0x87ebe)
            #1  0x00007f9d325bf720 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8a720)
            #2  0x00007f9d29f17b19 cnd_wait (radeonsi_dri.so + 0x117b19)
            #3  0x00007f9d29ef7edb util_queue_thread_func (radeonsi_dri.so + 0xf7edb)
            #4  0x00007f9d29f17a57 impl_thrd_routine (radeonsi_dri.so + 0x117a57)
            #5  0x00007f9d325c0383 start_thread (libc.so.6 + 0x8b383)
            #6  0x00007f9d3264300c __clone3 (libc.so.6 + 0x10e00c)
            
            Stack trace of thread 1440933:
            #0  0x00007f9d325bcebe __futex_abstimed_wait_common (libc.so.6 + 0x87ebe)
            #1  0x00007f9d325bf720 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8a720)
            #2  0x00007f9d29f17b19 cnd_wait (radeonsi_dri.so + 0x117b19)
            #3  0x00007f9d29ef7edb util_queue_thread_func (radeonsi_dri.so + 0xf7edb)
            #4  0x00007f9d29f17a57 impl_thrd_routine (radeonsi_dri.so + 0x117a57)
            #5  0x00007f9d325c0383 start_thread (libc.so.6 + 0x8b383)
            #6  0x00007f9d3264300c __clone3 (libc.so.6 + 0x10e00c)
            
            Stack trace of thread 1440932:
            #0  0x00007f9d325bcebe __futex_abstimed_wait_common (libc.so.6 + 0x87ebe)
            #1  0x00007f9d325bf720 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8a720)
            #2  0x00007f9d29f17b19 cnd_wait (radeonsi_dri.so + 0x117b19)
            #3  0x00007f9d29ef7edb util_queue_thread_func (radeonsi_dri.so + 0xf7edb)
            #4  0x00007f9d29f17a57 impl_thrd_routine (radeonsi_dri.so + 0x117a57)
            #5  0x00007f9d325c0383 start_thread (libc.so.6 + 0x8b383)
            #6  0x00007f9d3264300c __clone3 (libc.so.6 + 0x10e00c)
            ELF object binary architecture: AMD x86-64
</details>

Hyprland Crashes on Startup When Attempting To Load split-monitor-workspaces

Hyprland Crashes With Seg Fault When being started with split-monitor-workspaces through hyprload

  • Crashing began after recent update
  • Receives "Getting Dispatcher!" and failure to start Xwayland in terminal
  • hyprland crash report log has [LOG] [hyprload] Loading plugin: split-monitor-workspaces.so as last action before crash
  • Hyprland launches without issue when hyprload not auto started

Hyprland crashes when using: split-workspace, previous

split-workspace, previous causes Hyprland to crash without any trace in the log.
hyprland.log:

[wlr] [GLES2] GL_INVALID_OPERATION error generated. Wrong component type or count.
[wlr] [GLES2] GL_INVALID_OPERATION error generated. Wrong component type or count.
[wlr] [GLES2] GL_INVALID_OPERATION error generated. Wrong component type or count.
[wlr] [GLES2] GL_INVALID_OPERATION error generated. Wrong component type or count.
[wlr] [GLES2] GL_INVALID_OPERATION error generated. Wrong component type or count.
[wlr] [GLES2] GL_INVALID_OPERATION error generated. Wrong component type or count.
[wlr] [GLES2] GL_INVALID_OPERATION error generated. Wrong component type or count.
[wlr] [GLES2] GL_INVALID_OPERATION error generated. Wrong component type or count.
[wlr] [GLES2] GL_INVALID_OPERATION error generated. Wrong component type or count.
[wlr] [GLES2] GL_INVALID_OPERATION error generated. Wrong component type or count.
[wlr] [GLES2] GL_INVALID_OPERATION error generated. Wrong component type or count.
[wlr] [GLES2] GL_INVALID_OPERATION error generated. Wrong component type or count.
[wlr] [GLES2] GL_INVALID_OPERATION error generated. Wrong component type or count.
[wlr] [GLES2] GL_INVALID_OPERATION error generated. Wrong component type or count.
[wlr] [GLES2] GL_INVALID_OPERATION error generated. Wrong component type or count.
[wlr] [GLES2] GL_INVALID_OPERATION error generated. Wrong component type or count.
[wlr] [GLES2] GL_INVALID_OPERATION error generated. Wrong component type or count.
[LOG] Keybind triggered, calling dispatcher (64, , 65289)

System: Artix Linux
Hyprland version: hyprland-nvidia-git r2618.06244555-1
Nvidia Driver Version: 525.53

I am not sure what other relevant information there is to provide. If there is anything, ask me to do so.

Doesn't move windows to appropriate workspaces when unplugging motnitors

When unplugging monitors (for example, unplugging a dock from a laptop), this plugin doesn't move windows to appropriate workspaces on an existing monitor. This doesn't match dwm behavior, and makes for a poor experience with laptop setups.

I'm working on a (hacky) implementation of such a feature myself on my fork: https://github.com/UwUnyaa/split-monitor-workspaces/tree/handle-unplugging-monitors
This issue exists here to be in place for a possible pull request if needed, as well as any feedback regarding the behavior.

While I'm working on it (I need to beef up my debug setup with robust networking and a separate machine to run a debugger on), my question is, should the plugin attempt to move windows to appropriate workspaces on a monitor with the highest id, or should it move them to the zeroth monitor?

Manual installation build failed

Following the manual installation I put export HYPRLAND_HEADERS="$HOME/repos/Hyprland in my .zshrc without issue and then make all in the split-monitor-workspaces directory and got the following error:

g++ -shared -g -fPIC --no-gnu-unique -std=c++23 -I "/usr/include/pixman-1" -I "/usr/include/libdrm" -I "/home/seb/repos/Hyprland" -I "/home/seb/repos/Hyprland/protocols" -I "/home/seb/repos/Hyprland/subprojects/wlroots/include" -I "/home/seb/repos/Hyprland/subprojects/wlroots/build/include" -Iinclude -DWLR_USE_UNSTABLE src/main.cpp -o split-monitor-workspaces.so src/main.cpp:1:10: fatal error: src/helpers/Color.hpp: No such file or directory 1 | #include <src/helpers/Color.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:43: split-monitor-workspaces.so] Error 1

The Hyprland wiki is only usefull after a succesful creation of a .so file so that didn't help.

Build failed

I wanted to install this plugin using hyprload, but hyprload failed to build, so I tried to do it manually.
I have followed the build instructions, but it also fails to build and I don't know why.
This is the stacktrace:

g++ -shared -g -fPIC --no-gnu-unique -std=c++23 -I "/usr/include/pixman-1" -I "/usr/include/libdrm" -I "/home/mattia/.local/share/HyprlandRepo/Hyprland/" -I "/home/mattia/.local/share/HyprlandRepo/Hyprland//protocols" -I "/home/mattia/.local/share/HyprlandRepo/Hyprland//subprojects/wlroots/include" -I "/home/mattia/.local/share/HyprlandRepo/Hyprland//subprojects/wlroots/build/include" -Iinclude -DWLR_USE_UNSTABLE src/main.cpp -o split-monitor-workspaces.so
In file included from /home/mattia/.local/share/HyprlandRepo/Hyprland/src/managers/../defines.hpp:1,
                 from /home/mattia/.local/share/HyprlandRepo/Hyprland/src/managers/KeybindManager.hpp:3,
                 from src/main.cpp:2:
/home/mattia/.local/share/HyprlandRepo/Hyprland/src/managers/../includes.hpp:36:10: fatal error: wlr/backend.h: No such file or directory
   36 | #include <wlr/backend.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:43: split-monitor-workspaces.so] Error 1

Any idea why?

Plugin crashed in init. Unloading

After updating Hyprland today, this plugin now fails to load using hyprpm. In the hyprland log i get this error:

[ERR]  [PluginSystem] Plugin /home/<user>/.local/share/hyprpm/split-monitor-workspaces/split-monitor-workspaces.so (Handle 55a371622c40) crashed in init. Unloading.
[LOG]  [PluginSystem] Plugin  unloaded.

Trying to load the plugin manually using hyprctl plugin load /home/<user>/.local/share/hyprpm/split-monitor-workspaces/split-monitor-workspaces.so i get the same error but a little bit more detailed:

error in loading plugin, last error: Plugin /home/<user>/.local/share/hyprpm/split-monitor-workspaces/split-monitor-workspaces.so could not be loaded: plugin crashed/threw in main: std::bad_alloc

I tried removing and reinstalling the headers in /usr/local/include/hyprland /usr/include/hyprland but i still get the error.

NixOS Build error (refreshMapping)

error: builder for '/nix/store/ggmp5h0php8wz19s2brhi4vinh52v9zr-split-monitor-workspaces-0.1.drv' failed with exit code 1;
┃        last 10 log lines:
┃        >   182 |     e_monitorAddedHandle = HyprlandAPI::registerCallbackDynamic(PHANDLE, "monitorAdded", refreshMapping);>       |                                                                                          ^~~~~~~~~~~~~~
┃        >       |                                                                                          |>       |                                                                                          void (*)(void*, int&, std::any)
┃        > ../src/main.cpp:183:94: error: could not convert 'refreshMapping' from 'void (*)(void*, int&, std::any)' to 'HOOK_CALLBACK_FN' {aka 'std::function<void(void*, std::any)>'}
┃        >   183 |     e_monitorRemovedHandle = HyprlandAPI::registerCallbackDynamic(PHANDLE, "monitorRemoved", refreshMapping);>       |                                                                                              ^~~~~~~~~~~~~~
┃        >       |                                                                                              |>       |                                                                                              void (*)(void*, int&, std::any)
┃        > ninja: build stopped: subcommand failed.

Build failuire against Hyprland 69a4f08dbee6dc08d1e2ce498ce80ab20844e4f3 on NixOS

Output

error: builder for '/nix/store/7y8r4c4h8xra3w02gxap1xljyzpzxc6i-split-monitor-workspaces-0.1.drv' failed with exit code 1;
       last 10 log lines:
       >    63 | struct SConfigValue;
       >       |        ^~~~~~~~~~~~
       > ../src/main.cpp:168:83: error: C99 designator 'intValue' outside aggregate initializer
       >   168 |     HyprlandAPI::addConfigValue(PHANDLE, k_keepFocused, SConfigValue{.intValue = 0});
       >       |                                                                                   ^
       > ../src/main.cpp:168:83: error: invalid use of incomplete type 'struct SConfigValue'
       > /nix/store/2fp6h33gx8iij8iag40lwm455iyzalf0-hyprland-0.35.0+date=2024-02-19_69a4f08-dev/include/hyprland/src/plugins/PluginAPI.hpp:63:8: note: forward declaration of 'struct SConfigValue'
       >    63 | struct SConfigValue;
       >       |        ^~~~~~~~~~~~
       > ninja: build stopped: subcommand failed.
       For full logs, run 'nix log /nix/store/7y8r4c4h8xra3w02gxap1xljyzpzxc6i-split-monitor-workspaces-0.1.drv'.
error: 1 dependencies of derivation '/nix/store/fkhkxaswps0ni4xk1vskjhvjq5j6r0pq-hm_hyprhyprland.conf.drv' failed to build
error: 1 dependencies of derivation '/nix/store/dih7qikmsa2c8w1jwj07vs4bw7bv6mrl-activation-script.drv' failed to build
error: 1 dependencies of derivation '/nix/store/i0yhr5qbzp7y6wjq4a61imhjjb7s38vl-home-manager-generation.drv' failed to build
error: 1 dependencies of derivation '/nix/store/53apwnndyxk1ybhdz60nsl53cr4373ar-unit-home-manager-noah.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/gxla127dc3ddvag7xs1mxmdpqhb6p8jq-system-units.drv' failed to build
error: 1 dependencies of derivation '/nix/store/4y4whrzj8f4h4a2vslsaa01nx1m8kwc7-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/v81hmxwy4x1852lpwj3j6qqidd03sh1x-nixos-system-nixos-24.05.20240216.5863c27.drv' failed to build

Full log

@nix { "action": "setPhase", "phase": "unpackPhase" }
Running phase: unpackPhase
unpacking source archive /nix/store/3q7zdqhsm74fczvii07lvaz91h841wal-source
source root is source
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
Running phase: configurePhase
mesonConfigurePhase flags: --prefix=/nix/store/xz69k75al3gy5g1jhk66schxaaps84zg-split-monitor-workspaces-0.1 --libdir=/nix/store/xz69k75al3gy5g1jhk66schxaaps84zg-split-monitor-workspaces-0.1/lib --libexecdir=/>
The Meson build system
Version: 1.3.1
Source dir: /build/source
Build dir: /build/source/build
Build type: native build
Project name: split-monitor-workspaces
Project version: 0.1
C++ compiler for the host machine: g++ (gcc 13.2.0 "g++ (GCC) 13.2.0")
C++ linker for the host machine: g++ ld.bfd 2.40
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C++ supports arguments -std=c++23: YES
meson.build:8: WARNING: Consider using the built-in option for language standard version instead of using "-std=c++23".
Found pkg-config: YES (/nix/store/knxv5h4hsh86c649rabd6dqfd97kwp5d-pkg-config-wrapper-0.29.2/bin/pkg-config) 0.29.2
Run-time dependency hyprland found: YES 0.35.0
Run-time dependency pixman-1 found: YES 0.43.2
Run-time dependency libdrm found: YES 2.4.120
Build targets in project: 1

split-monitor-workspaces 0.1

  User defined options
    auto_features: enabled
    bindir       : /nix/store/xz69k75al3gy5g1jhk66schxaaps84zg-split-monitor-workspaces-0.1/bin
    buildtype    : plain
    includedir   : /nix/store/xz69k75al3gy5g1jhk66schxaaps84zg-split-monitor-workspaces-0.1/include
    infodir      : /nix/store/xz69k75al3gy5g1jhk66schxaaps84zg-split-monitor-workspaces-0.1/share/info
    libdir       : /nix/store/xz69k75al3gy5g1jhk66schxaaps84zg-split-monitor-workspaces-0.1/lib
    libexecdir   : /nix/store/xz69k75al3gy5g1jhk66schxaaps84zg-split-monitor-workspaces-0.1/libexec
    localedir    : /nix/store/xz69k75al3gy5g1jhk66schxaaps84zg-split-monitor-workspaces-0.1/share/locale
    mandir       : /nix/store/xz69k75al3gy5g1jhk66schxaaps84zg-split-monitor-workspaces-0.1/share/man
    prefix       : /nix/store/xz69k75al3gy5g1jhk66schxaaps84zg-split-monitor-workspaces-0.1
    sbindir      : /nix/store/xz69k75al3gy5g1jhk66schxaaps84zg-split-monitor-workspaces-0.1/sbin
    wrap_mode    : nodownload

Found ninja-1.11.1 at /nix/store/0xns1gyza3sm938pc7klvzrjk5iqam9l-ninja-1.11.1/bin/ninja
mesonConfigurePhase: enabled\ parallel\ building
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: buildPhase
build flags: -j16
[1/2] Compiling C++ object libsplit-monitor-workspaces.so.p/src_main.cpp.o
FAILED: libsplit-monitor-workspaces.so.p/src_main.cpp.o
g++ -Ilibsplit-monitor-workspaces.so.p -I. -I.. -I../include -I/nix/store/2fp6h33gx8iij8iag40lwm455iyzalf0-hyprland-0.35.0+date=2024-02-19_69a4f08-dev/include -I/nix/store/2fp6h33gx8iij8iag40lwm455iyzalf0-hypr>
../src/main.cpp: In function 'void mapWorkspacesToMonitors()':
../src/main.cpp:125:41: error: 'class CConfigManager' has no member named 'getConfigValuePtrSafe'; did you mean 'getConfigValuePtr'?
  125 |     int keepFocused = g_pConfigManager->getConfigValuePtrSafe(k_keepFocused)->intValue;
      |                                         ^~~~~~~~~~~~~~~~~~~~~
      |                                         getConfigValuePtr
../src/main.cpp:128:48: error: 'class CConfigManager' has no member named 'getConfigValuePtrSafe'; did you mean 'getConfigValuePtr'?
  128 |         int workspaceCount = g_pConfigManager->getConfigValuePtrSafe(k_workspaceCount)->intValue;
      |                                                ^~~~~~~~~~~~~~~~~~~~~
      |                                                getConfigValuePtr
../src/main.cpp: In function 'PLUGIN_DESCRIPTION_INFO pluginInit(void*)':
../src/main.cpp:167:87: error: C99 designator 'intValue' outside aggregate initializer
  167 |     HyprlandAPI::addConfigValue(PHANDLE, k_workspaceCount, SConfigValue{.intValue = 10});
      |                                                                                       ^
../src/main.cpp:167:87: error: invalid use of incomplete type 'struct SConfigValue'
In file included from /nix/store/2fp6h33gx8iij8iag40lwm455iyzalf0-hyprland-0.35.0+date=2024-02-19_69a4f08-dev/include/hyprland/src/managers/HookSystemManager.hpp:12,
                 from /nix/store/2fp6h33gx8iij8iag40lwm455iyzalf0-hyprland-0.35.0+date=2024-02-19_69a4f08-dev/include/hyprland/src/protocols/Screencopy.hpp:8,
                 from /nix/store/2fp6h33gx8iij8iag40lwm455iyzalf0-hyprland-0.35.0+date=2024-02-19_69a4f08-dev/include/hyprland/src/protocols/ToplevelExport.hpp:6,
                 from /nix/store/2fp6h33gx8iij8iag40lwm455iyzalf0-hyprland-0.35.0+date=2024-02-19_69a4f08-dev/include/hyprland/src/managers/ProtocolManager.hpp:4,
                 from /nix/store/2fp6h33gx8iij8iag40lwm455iyzalf0-hyprland-0.35.0+date=2024-02-19_69a4f08-dev/include/hyprland/src/Compositor.hpp:18,
                 from ../src/main.cpp:3:
/nix/store/2fp6h33gx8iij8iag40lwm455iyzalf0-hyprland-0.35.0+date=2024-02-19_69a4f08-dev/include/hyprland/src/plugins/PluginAPI.hpp:63:8: note: forward declaration of 'struct SConfigValue'
   63 | struct SConfigValue;
      |        ^~~~~~~~~~~~
../src/main.cpp:168:83: error: C99 designator 'intValue' outside aggregate initializer
  168 |     HyprlandAPI::addConfigValue(PHANDLE, k_keepFocused, SConfigValue{.intValue = 0});
      |                                                                                   ^
../src/main.cpp:168:83: error: invalid use of incomplete type 'struct SConfigValue'
/nix/store/2fp6h33gx8iij8iag40lwm455iyzalf0-hyprland-0.35.0+date=2024-02-19_69a4f08-dev/include/hyprland/src/plugins/PluginAPI.hpp:63:8: note: forward declaration of 'struct SConfigValue'
   63 | struct SConfigValue;
      |        ^~~~~~~~~~~~
ninja: build stopped: subcommand failed.

Flake.lock

{
  "nodes": {
    "home-manager": {
      "inputs": {
        "nixpkgs": [
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1708294481,
        "narHash": "sha256-DZtxmeb4OR7iCaKUUuq05ADV2rX8WReZEF7Tq//W0+Y=",
        "owner": "nix-community",
        "repo": "home-manager",
        "rev": "a54e05bc12d88ff2df941d0dc1183cb5235fa438",
        "type": "github"
      },
      "original": {
        "owner": "nix-community",
        "repo": "home-manager",
        "type": "github"
      }
    },
    "hyprland": {
      "inputs": {
        "hyprland-protocols": "hyprland-protocols",
        "hyprlang": "hyprlang",
        "nixpkgs": "nixpkgs",
        "systems": "systems",
        "wlroots": "wlroots",
        "xdph": "xdph"
      },
      "locked": {
        "lastModified": 1708300923,
        "narHash": "sha256-TnZ4E2AZbRXcm5tuior9KMNSjruy11Oqic0yc7ySU1U=",
        "owner": "hyprwm",
        "repo": "Hyprland",
        "rev": "69a4f08dbee6dc08d1e2ce498ce80ab20844e4f3",
        "type": "github"
      },
      "original": {
        "owner": "hyprwm",
        "repo": "Hyprland",
        "type": "github"
      }
    },
    "hyprland-protocols": {
      "inputs": {
        "nixpkgs": [
          "hyprland",
          "nixpkgs"
        ],
        "systems": [
          "hyprland",
          "systems"
        ]
      },
      "locked": {
        "lastModified": 1691753796,
        "narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=",
        "owner": "hyprwm",
        "repo": "hyprland-protocols",
        "rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03",
        "type": "github"
      },
      "original": {
        "owner": "hyprwm",
        "repo": "hyprland-protocols",
        "type": "github"
      }
    },
    "hyprlang": {
      "inputs": {
        "nixpkgs": [
          "hyprland",
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1708005943,
        "narHash": "sha256-9TT3xk++LI5/SPYgjYX34xZ4ebR93c1uerIq+SE/ues=",
        "owner": "hyprwm",
        "repo": "hyprlang",
        "rev": "aeb3e012adc7b3235335c540b214b82267c2b983",
        "type": "github"
      },
      "original": {
        "owner": "hyprwm",
        "repo": "hyprlang",
        "type": "github"
      }
    },
    "hyprlang_2": {
      "inputs": {
        "nixpkgs": [
          "hyprland",
          "xdph",
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1704287638,
        "narHash": "sha256-TuRXJGwtK440AXQNl5eiqmQqY4LZ/9+z/R7xC0ie3iA=",
        "owner": "hyprwm",
        "repo": "hyprlang",
        "rev": "6624f2bb66d4d27975766e81f77174adbe58ec97",
        "type": "github"
      },
      "original": {
        "owner": "hyprwm",
        "repo": "hyprlang",
        "type": "github"
      }
    },
    "nix-filter": {
      "locked": {
        "lastModified": 1693833173,
        "narHash": "sha256-hlMABKrGbEiJD5dwUSfnw1CQ3bG7KKwDV+Nx3bEZd7U=",
        "owner": "numtide",
        "repo": "nix-filter",
        "rev": "ac030bd9ba98e318e1f4c4328d60766ade8ebe8b",
        "type": "github"
      },
      "original": {
        "owner": "numtide",
        "repo": "nix-filter",
        "type": "github"
      }
    },
    "nixpkgs": {
      "locked": {
        "lastModified": 1707546158,
        "narHash": "sha256-nYYJTpzfPMDxI8mzhQsYjIUX+grorqjKEU9Np6Xwy/0=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "d934204a0f8d9198e1e4515dd6fec76a139c87f0",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "nixos-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "nixpkgs_2": {
      "locked": {
        "lastModified": 1708118438,
        "narHash": "sha256-kk9/0nuVgA220FcqH/D2xaN6uGyHp/zoxPNUmPCMmEE=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "5863c27340ba4de8f83e7e3c023b9599c3cb3c80",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "nixos-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "nur": {
      "locked": {
        "lastModified": 1708322991,
        "narHash": "sha256-faAddXI8xOjs3u5TcMvGLkcWVjaFVWJjG9G3lsvIVwU=",
        "owner": "nix-community",
        "repo": "NUR",
        "rev": "119ba100d25078d371915db9b8598a5e68cd874f",
        "type": "github"
      },
      "original": {
        "owner": "nix-community",
        "repo": "NUR",
        "type": "github"
      }
    },
    "root": {
      "inputs": {
        "home-manager": "home-manager",
        "hyprland": "hyprland",
        "nixpkgs": "nixpkgs_2",
        "nur": "nur",
        "split-monitor-workspaces": "split-monitor-workspaces"
      }
    },
    "split-monitor-workspaces": {
      "inputs": {
        "hyprland": [
          "hyprland"
        ],
        "nix-filter": "nix-filter"
      },
      "locked": {
        "lastModified": 1698179193,
        "narHash": "sha256-zDW+72enuRGuLLRbO1+pYk8FgRjQrBGksIAOk88OwOI=",
        "owner": "Duckonaut",
        "repo": "split-monitor-workspaces",
        "rev": "2b1abdbf9e9de9ee660540167c8f51903fa3d959",
        "type": "github"
      },
      "original": {
        "owner": "Duckonaut",
        "repo": "split-monitor-workspaces",
        "type": "github"
      }
    },
    "systems": {
      "locked": {
        "lastModified": 1689347949,
        "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
        "owner": "nix-systems",
        "repo": "default-linux",
        "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
        "type": "github"
      },
      "original": {
        "owner": "nix-systems",
        "repo": "default-linux",
        "type": "github"
      }
    },
    "wlroots": {
      "flake": false,
      "locked": {
        "host": "gitlab.freedesktop.org",
        "lastModified": 1706359063,
        "narHash": "sha256-5HUTG0p+nCJv3cn73AmFHRZdfRV5AD5N43g8xAePSKM=",
        "owner": "wlroots",
        "repo": "wlroots",
        "rev": "00b869c1a96f300a8f25da95d624524895e0ddf2",
        "type": "gitlab"
      },
      "original": {
        "host": "gitlab.freedesktop.org",
        "owner": "wlroots",
        "repo": "wlroots",
        "rev": "00b869c1a96f300a8f25da95d624524895e0ddf2",
        "type": "gitlab"
      }
    },
    "xdph": {
      "inputs": {
        "hyprland-protocols": [
          "hyprland",
          "hyprland-protocols"
        ],
        "hyprlang": "hyprlang_2",
        "nixpkgs": [
          "hyprland",
          "nixpkgs"
        ],
        "systems": [
          "hyprland",
          "systems"
        ]
      },
      "locked": {
        "lastModified": 1706521509,
        "narHash": "sha256-AInZ50acOJ3wzUwGzNr1TmxGTMx+8j6oSTzz4E7Vbp8=",
        "owner": "hyprwm",
        "repo": "xdg-desktop-portal-hyprland",
        "rev": "c06fd88b3da492b8f9067be021b9184f7012b5a8",
        "type": "github"
      },
      "original": {
        "owner": "hyprwm",
        "repo": "xdg-desktop-portal-hyprland",
        "type": "github"
      }
    }
  },
  "root": "root",
  "version": 7
}

Bad workspace rule command overwrites user defined rules

This line:

HyprlandAPI::invokeHyprctlCommand("keyword", "workspace " + workspaceName + "," + monitor->szName);

creates a bunch of empty workspace rules. I think the syntax should actually be 'keyword workspace DP-4,23' (monitor, then workspace).

However, issuing this command will still overwrite any user defined workspace rules from the config file.

Things seem to work fine without it, tho.

Disable notification on startup

Is it possible to disable the notification that shows that the plugin has been started successfully? I see the plugin uses the addNotification call, but I'd rather if the popup didn't show on success, rather that it would only notify me if it fails.

Build fails (hyprpm)

I'm quite new to the Hyprland ecosystem, apologies as I'm not very familiar with it.

I have the latest Hyprland installed (self-compiled, commit 220144276b8789d05e58df3e0452314c11b64728)

Output from running hyprpm -v add https://github.com/Duckonaut/split-monitor-workspaces:

allison ~ % hyprpm -v add https://github.com/Duckonaut/split-monitor-workspaces                                                                                                                                                       [ OK ]
[v] version returned: Hyprland, built from branch main at commit 220144276b8789d05e58df3e0452314c11b64728  (layout: unfullscreen on toggle into tiled fullscreen).
Date: Sun Mar 10 17:31:49 2024
Tag: v0.36.0-97-g22014427

flags: (if any)


[v] parsed commit 220144276b8789d05e58df3e0452314c11b64728 at branch main
✔ adding a new plugin repository from https://github.com/Duckonaut/split-monitor-workspaces
  MAKE SURE that you trust the authors. DO NOT install random plugins without verifying the code and author.
  Are you sure? [Y/n] 

 → Cloning https://github.com/Duckonaut/split-monitor-workspaces                                                                                                                                                                             
✔ cloned                                                                                                                                                                                                                                     
✔ found hyprpm manifest                                                                                                                                                                                                                      
✔ parsed manifest, found 1 plugins:                                                                                                                                                                                                          
 → split-monitor-workspaces by Duckonaut version                                                                                                                                                                                             
✔ Hyprland headers OK                                                                                                                                                                                                                        
 → Building split-monitor-workspaces                                                                                                                                                                                                         
✖ Plugin split-monitor-workspaces failed to build.                                                                                                                                                                                           

 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╍━━━━━━━━━━━━━━━━━━━  3 / 5  Building plugin(s)[v] shell returned:  -> cd /tmp/hyprpm/new && PKG_CONFIG_PATH="/home/allison/.local/share/hyprpm/headersRoot/share/pkgconfig" meson setup build --wipe         
The Meson build system
Version: 1.3.2
Source dir: /tmp/hyprpm/new
Build dir: /tmp/hyprpm/new/build
Build type: native build
Project name: split-monitor-workspaces
Project version: 0.1
C++ compiler for the host machine: ccache c++ (gcc 13.2.1 "c++ (GCC) 13.2.1 20230801")
C++ linker for the host machine: c++ ld.bfd 2.42.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C++ supports arguments -std=c++23: YES 
meson.build:8: WARNING: Consider using the built-in option for language standard version instead of using "-std=c++23".
Found pkg-config: YES (/usr/bin/pkg-config) 2.1.0
Run-time dependency hyprland found: YES 0.36.0
Run-time dependency pixman-1 found: YES 0.43.4
Run-time dependency libdrm found: YES 2.4.120
Build targets in project: 1

Found ninja-1.11.1 at /usr/bin/ninja
                                                
 -> cd /tmp/hyprpm/new && PKG_CONFIG_PATH="/home/allison/.local/share/hyprpm/headersRoot/share/pkgconfig" meson compile -C build
ninja: Entering directory `/tmp/hyprpm/new/build'
[1/2] Compiling C++ object libsplit-monitor-workspaces.so.p/src_main.cpp.o
FAILED: libsplit-monitor-workspaces.so.p/src_main.cpp.o 
ccache c++ -Ilibsplit-monitor-workspaces.so.p -I. -I.. -I../include -I/home/allison/.local/share/hyprpm/headersRoot/include/hyprland/protocols -I/home/allison/.local/share/hyprpm/headersRoot/include/hyprland/wlroots -I/home/allison/.local/share/hyprpm/headersRoot/include -I/usr/include/pixman-1 -I/usr/include/libdrm -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O3 -std=c++23 -DWLR_USE_UNSTABLE -fPIC -MD -MQ libsplit-monitor-workspaces.so.p/src_main.cpp.o -MF libsplit-monitor-workspaces.so.p/src_main.cpp.o.d -o libsplit-monitor-workspaces.so.p/src_main.cpp.o -c ../src/main.cpp
In file included from /home/allison/.local/share/hyprpm/headersRoot/include/hyprland/src/config/../Window.hpp:8,
                 from /home/allison/.local/share/hyprpm/headersRoot/include/hyprland/src/config/ConfigManager.hpp:16,
                 from /home/allison/.local/share/hyprpm/headersRoot/include/hyprland/src/Compositor.hpp:10,
                 from ../src/main.cpp:3:
/home/allison/.local/share/hyprpm/headersRoot/include/hyprland/src/config/../config/ConfigDataValues.hpp: In member function ‘virtual std::string CGradientValueData::toString()’:
/home/allison/.local/share/hyprpm/headersRoot/include/hyprland/src/config/../config/ConfigDataValues.hpp:64:5: warning: no return statement in function returning non-void [-Wreturn-type]
   64 |     }
      |     ^
In file included from ../src/main.cpp:6:
/home/allison/.local/share/hyprpm/headersRoot/include/hyprland/src/helpers/Workspace.hpp: At global scope:
/home/allison/.local/share/hyprpm/headersRoot/include/hyprland/src/helpers/Workspace.hpp:7:6: error: multiple definition of ‘enum eFullscreenMode’
    7 | enum eFullscreenMode : int8_t {
      |      ^~~~~~~~~~~~~~~
In file included from /home/allison/.local/share/hyprpm/headersRoot/include/hyprland/src/Compositor.hpp:24:
/home/allison/.local/share/hyprpm/headersRoot/include/hyprland/src/desktop/Workspace.hpp:7:6: note: previous definition here
    7 | enum eFullscreenMode : int8_t {
      |      ^~~~~~~~~~~~~~~
/home/allison/.local/share/hyprpm/headersRoot/include/hyprland/src/helpers/Workspace.hpp:15:7: error: redefinition of ‘class CWorkspace’
   15 | class CWorkspace {
      |       ^~~~~~~~~~
/home/allison/.local/share/hyprpm/headersRoot/include/hyprland/src/desktop/Workspace.hpp:15:7: note: previous definition of ‘class CWorkspace’
   15 | class CWorkspace {
      |       ^~~~~~~~~~
ninja: build stopped: subcommand failed.
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -C /tmp/hyprpm/new/build


✔ all plugins built                                                                                                                                                                                                                          
✔ installed repository                                                                                                                                                                                                                       
✔ you can now enable the plugin(s) with hyprpm enable                                                                                                                                                                                        
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  5 / 5  Done!

hyprctl

i can't use the dispatcher with hyprctl:

~ hyprctl dispatch split-workspace,1
Invalid dispatcher

Switch Between Monitors

Not sure if this is the right place to ask... Is there a way to switch between monitors and send windows to monitors like

awful.screen.focus_relative(-1)
client:move_to_screen(client.screen.index - 1)

in awesomewm?

Use workspace names from hyprland config instead of setting them automatically

Right now, it looks like the mapping of the workspace ID's are done automatically (main.cpp#L58), and the workspace= settings from the hyprland config are being overwritten with that automatic mapping.

I think it would be better if the workspace settings are looked at first, and if a monitor does not have workspaces set, fall back to automatic mapping for that monitor.

I use waybar's persistent workspaces, and this requires setting the workspaces manually. I usually have 2 monitors on either side of my laptop, but if I unplug them and only use my laptop screen, this plugin will make my laptop have workspaces 1-5, instead of 21-25. This screws up my bar, resulting in this situation when switching workspaces using my hotkeys:

example.mp4

The perfect solution would be some kind of solution that syncs with waybar's config, so I don't have to manually specify the workspaces for every monitor. Unplugging & replugging monitors should work seamlessly then.

split-changemonitor not executing in one direction

Using the split-change monitor setup I cant send a window from middle screen to left.

I have a three screen setup:

HDMI-A-2 (ID 2) | DP-1 (ID 0)| DP-2 (ID 1)

monitors are configured as this:

monitor=DP-1,3440x1440@144,0x240,1,vrr,1                                          
monitor=DP-2,1920x1080@144,3440x0,1,transform,1                                  
monitor=HDMI-A-2,1920x1080@144,-1920x420,1,vrr,1 

Using hyprctl dispatch split-changemonitor +1 I get the expected behavior:
Windows cycle through HDMI-A-2 --> DP-1 --> DP-2 --> HDMI-A-2 ...

but with hyprctl dispatch split-changemonitor -1 :

<-- HDMI-A-2 <-/- DP-1 <-- DP-2

It seems like with +1 it will correctly wrap from 2 -> 0 but with -1 it wont map from 0 to 2.

Great plugin, exactly what I need to switch from dwm to hyprland!

Crash on b80c72c7ddbf79147d64759c8659eb5939d0327e on nixos

unfortunately no crash report from hyprland, the only thing I have is its output and here's what that tells me:

[ERR] [hookSystem] Hook from plugin 15255a0 caused a SIGSEGV, queueing for unloading.
[LOG]  [PluginSystem] Plugin split-monitor-workspaces unloaded.

launching without the plugin works fine, with it crashes instantly

Makefile assumes Xwayland

I packaged your plugin for Gentoo, and noticed that the build fails if wlroots is built without Xwayland support:

~/git/split-monitor-workspaces $ g++ -shared -fPIC --no-gnu-unique $SOURCE_FILES -o $PLUGIN_NAME.so -g -I "/usr/include/pixman-1" -I "/usr/include/libdrm" -I "${HYPRLAND_HEADERS}" -Iinclude -std=c++23
In file included from /home/jroy/git/Hyprland/src/managers/../defines.hpp:1,
                 from /home/jroy/git/Hyprland/src/managers/KeybindManager.hpp:3,
                 from src/main.cpp:3:
/home/jroy/git/Hyprland/src/managers/../includes.hpp:115:10: fatal error: wlr/xwayland.h: No such file or directory
  115 | #include <wlr/xwayland.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.

Passing -DNO_XWAYLAND to the g++ command solves the problem.
For the Gentoo package, if wlroots is built without Xwayland support, I patch the makefile to add the -DNO_XWAYLAND parameter to g++, but it would be nice to have a cleaner solution

[Feature] More configuration options

Hey !

First of all I love this plugin, I've been using it for a few months and coming fro AWM I can't say that it became a must in my config.

However, I'd love to use this plugin with something like kanshi.

For that I would need to be able to assign monitor to workspace in the split-monitor-worksapaces config. The must would be using the display name like kanshi allows you.

Something like specifying the monitor name and the starting number for that monitor workspaces.

How possible do you think that would be ?

Fail to install via hyprpm

this error is emitted when running hyprpm add https://github.com/Duckonaut/split-monitor-workspaces -v

The Meson build system
Version: 1.3.2
Source dir: /tmp/hyprpm/new
Build dir: /tmp/hyprpm/new/build
Build type: native build
Project name: split-monitor-workspaces
Project version: 0.1
C++ compiler for the host machine: c++ (gcc 13.2.1 "c++ (GCC) 13.2.1 20230801")
C++ linker for the host machine: c++ ld.bfd 2.42.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C++ supports arguments -std=c++23: YES 
meson.build:8: WARNING: Consider using the built-in option for language standard version instead of using "-std=c++23".
Found pkg-config: YES (/usr/bin/pkg-config) 2.1.0
Run-time dependency hyprland found: YES 0.35.0
Run-time dependency pixman-1 found: YES 0.43.2
Run-time dependency libdrm found: YES 2.4.120
Build targets in project: 1

Found ninja-1.11.1 at /usr/bin/ninja
                                                
 -> cd /tmp/hyprpm/new && PKG_CONFIG_PATH="/home/cadenz/.local/share/hyprpm/headersRoot/share/pkgconfig" meson compile -C build
ninja: Entering directory `/tmp/hyprpm/new/build'
[1/2] Compiling C++ object libsplit-monitor-workspaces.so.p/src_main.cpp.o
FAILED: libsplit-monitor-workspaces.so.p/src_main.cpp.o 
c++ -Ilibsplit-monitor-workspaces.so.p -I. -I.. -I../include -I/home/cadenz/.local/share/hyprpm/headersRoot/include/hyprland/protocols -I/home/cadenz/.local/share/hyprpm/headersRoot/include/hyprland/wlroots -I/home/cadenz/.local/share/hyprpm/headersRoot/include -I/usr/include/pixman-1 -I/usr/include/libdrm -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O3 -std=c++23 -DWLR_USE_UNSTABLE -fPIC -MD -MQ libsplit-monitor-workspaces.so.p/src_main.cpp.o -MF libsplit-monitor-workspaces.so.p/src_main.cpp.o.d -o libsplit-monitor-workspaces.so.p/src_main.cpp.o -c ../src/main.cpp
../src/main.cpp: In function ‘void mapWorkspacesToMonitors()’:
../src/main.cpp:125:45: error: ‘Hyprlang’ has not been declared
  125 |     static auto* const workspaceCountPtr = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, k_workspaceCount)->getDataStaticPtr();
      |                                             ^~~~~~~~
../src/main.cpp:125:60: error: expected primary-expression before ‘const’
  125 |     static auto* const workspaceCountPtr = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, k_workspaceCount)->getDataStaticPtr();
      |                                                            ^~~~~
../src/main.cpp:125:59: error: expected ‘)’ before ‘const’
  125 |     static auto* const workspaceCountPtr = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, k_workspaceCount)->getDataStaticPtr();
      |                                            ~              ^~~~~~
      |                                                           )
../src/main.cpp:126:42: error: ‘Hyprlang’ has not been declared
  126 |     static auto* const keepFocusedPtr = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, k_keepFocused)->getDataStaticPtr();
      |                                          ^~~~~~~~
../src/main.cpp:126:57: error: expected primary-expression before ‘const’
  126 |     static auto* const keepFocusedPtr = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, k_keepFocused)->getDataStaticPtr();
      |                                                         ^~~~~
../src/main.cpp:126:56: error: expected ‘)’ before ‘const’
  126 |     static auto* const keepFocusedPtr = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, k_keepFocused)->getDataStaticPtr();
      |                                         ~              ^~~~~~
      |                                                        )
../src/main.cpp: In function ‘PLUGIN_DESCRIPTION_INFO pluginInit(void*)’:
../src/main.cpp:170:60: error: ‘Hyprlang’ has not been declared
  170 |     HyprlandAPI::addConfigValue(PHANDLE, k_workspaceCount, Hyprlang::INT{10});
      |                                                            ^~~~~~~~
../src/main.cpp:171:57: error: ‘Hyprlang’ has not been declared
  171 |     HyprlandAPI::addConfigValue(PHANDLE, k_keepFocused, Hyprlang::INT{0});
      |                                                         ^~~~~~~~
ninja: build stopped: subcommand failed.
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -C /tmp/hyprpm/new/build

Hyprland version: 0.35.0-2

failed to build with Hyprland 0.39.1

Hyprland headers found.
Building with XWayland support.
g++ -shared -g -fPIC --no-gnu-unique -std=c++23 `pkg-config --cflags pixman-1 libdrm hyprland` -Iinclude -DWLR_USE_UNSTABLE src/main.cpp -o split-monitor-workspaces.so
src/main.cpp: In function 'PLUGIN_DESCRIPTION_INFO pluginInit(void*)':
src/main.cpp:254:104: error: no match for 'operator=' (operand types are 'std::shared_ptr<std::function<void(void*, SCallbackInfo&, std::any)> >' and 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'})
  254 | itorAddedHandle = HyprlandAPI::registerCallbackDynamic(PHANDLE, "monitorAdded", refreshMapping);
      |                                                                                               ^

In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/memory:80,
                 from /usr/include/hyprland/src/Compositor.hpp:3,
                 from src/main.cpp:3:
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:418:9: note: candidate: 'template<class _Yp> std::shared_ptr<_Tp>::_Assignable<const std::shared_ptr<_Yp>&> std::shared_ptr<_Tp>::operator=(const std::shared_ptr<_Yp>&) [with _Tp = std::function<void(void*, SCallbackInfo&, std::any)>]'
  418 |         operator=(const shared_ptr<_Yp>& __r) noexcept
      |         ^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:418:9: note:   template argument deduction/substitution failed:
src/main.cpp:254:104: note:   mismatched types 'const std::shared_ptr<_Tp>' and 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'}
  254 | itorAddedHandle = HyprlandAPI::registerCallbackDynamic(PHANDLE, "monitorAdded", refreshMapping);
      |                                                                                               ^

/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:429:9: note: candidate: 'template<class _Yp> std::shared_ptr<_Tp>::_Assignable<std::auto_ptr<_Up> > std::shared_ptr<_Tp>::operator=(std::auto_ptr<_Up>&&) [with _Tp = std::function<void(void*, SCallbackInfo&, std::any)>]'
  429 |         operator=(auto_ptr<_Yp>&& __r)
      |         ^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:429:9: note:   template argument deduction/substitution failed:
src/main.cpp:254:104: note:   mismatched types 'std::auto_ptr<_Up>' and 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'}
  254 | itorAddedHandle = HyprlandAPI::registerCallbackDynamic(PHANDLE, "monitorAdded", refreshMapping);
      |                                                                                               ^

/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:446:9: note: candidate: 'template<class _Yp> std::shared_ptr<_Tp>::_Assignable<std::shared_ptr<_Yp> > std::shared_ptr<_Tp>::operator=(std::shared_ptr<_Yp>&&) [with _Tp = std::function<void(void*, SCallbackInfo&, std::any)>]'
  446 |         operator=(shared_ptr<_Yp>&& __r) noexcept
      |         ^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:446:9: note:   template argument deduction/substitution failed:
src/main.cpp:254:104: note:   mismatched types 'std::shared_ptr<_Tp>' and 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'}
  254 | itorAddedHandle = HyprlandAPI::registerCallbackDynamic(PHANDLE, "monitorAdded", refreshMapping);
      |                                                                                               ^

/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:454:9: note: candidate: 'template<class _Yp, class _Del> std::shared_ptr<_Tp>::_Assignable<std::unique_ptr<_Up, _Ep> > std::shared_ptr<_Tp>::operator=(std::unique_ptr<_Up, _Ep>&&) [with _Del = _Yp; _Tp = std::function<void(void*, SCallbackInfo&, std::any)>]'
  454 |         operator=(unique_ptr<_Yp, _Del>&& __r)
      |         ^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:454:9: note:   template argument deduction/substitution failed:
src/main.cpp:254:104: note:   mismatched types 'std::unique_ptr<_Tp, _Dp>' and 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'}
  254 | itorAddedHandle = HyprlandAPI::registerCallbackDynamic(PHANDLE, "monitorAdded", refreshMapping);
      |                                                                                               ^

/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:414:19: note: candidate: 'std::shared_ptr<_Tp>& std::shared_ptr<_Tp>::operator=(const std::shared_ptr<_Tp>&) [with _Tp = std::function<void(void*, SCallbackInfo&, std::any)>]'
  414 |       shared_ptr& operator=(const shared_ptr&) noexcept = default;
      |                   ^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:414:29: note:   no known conversion for argument 1 from 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'} to 'const std::shared_ptr<std::function<void(void*, SCallbackInfo&, std::any)> >&'
  414 |       shared_ptr& operator=(const shared_ptr&) noexcept = default;
      |                             ^~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:438:7: note: candidate: 'std::shared_ptr<_Tp>& std::shared_ptr<_Tp>::operator=(std::shared_ptr<_Tp>&&) [with _Tp = std::function<void(void*, SCallbackInfo&, std::any)>]'
  438 |       operator=(shared_ptr&& __r) noexcept
      |       ^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:438:30: note:   no known conversion for argument 1 from 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'} to 'std::shared_ptr<std::function<void(void*, SCallbackInfo&, std::any)> >&&'
  438 |       operator=(shared_ptr&& __r) noexcept
      |                 ~~~~~~~~~~~~~^~~
src/main.cpp:255:108: error: no match for 'operator=' (operand types are 'std::shared_ptr<std::function<void(void*, SCallbackInfo&, std::any)> >' and 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'})
  255 | RemovedHandle = HyprlandAPI::registerCallbackDynamic(PHANDLE, "monitorRemoved", refreshMapping);
      |                                                                                               ^

/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:418:9: note: candidate: 'template<class _Yp> std::shared_ptr<_Tp>::_Assignable<const std::shared_ptr<_Yp>&> std::shared_ptr<_Tp>::operator=(const std::shared_ptr<_Yp>&) [with _Tp = std::function<void(void*, SCallbackInfo&, std::any)>]'
  418 |         operator=(const shared_ptr<_Yp>& __r) noexcept
      |         ^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:418:9: note:   template argument deduction/substitution failed:
src/main.cpp:255:108: note:   mismatched types 'const std::shared_ptr<_Tp>' and 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'}
  255 | RemovedHandle = HyprlandAPI::registerCallbackDynamic(PHANDLE, "monitorRemoved", refreshMapping);
      |                                                                                               ^

/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:429:9: note: candidate: 'template<class _Yp> std::shared_ptr<_Tp>::_Assignable<std::auto_ptr<_Up> > std::shared_ptr<_Tp>::operator=(std::auto_ptr<_Up>&&) [with _Tp = std::function<void(void*, SCallbackInfo&, std::any)>]'
  429 |         operator=(auto_ptr<_Yp>&& __r)
      |         ^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:429:9: note:   template argument deduction/substitution failed:
src/main.cpp:255:108: note:   mismatched types 'std::auto_ptr<_Up>' and 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'}
  255 | RemovedHandle = HyprlandAPI::registerCallbackDynamic(PHANDLE, "monitorRemoved", refreshMapping);
      |                                                                                               ^

/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:446:9: note: candidate: 'template<class _Yp> std::shared_ptr<_Tp>::_Assignable<std::shared_ptr<_Yp> > std::shared_ptr<_Tp>::operator=(std::shared_ptr<_Yp>&&) [with _Tp = std::function<void(void*, SCallbackInfo&, std::any)>]'
  446 |         operator=(shared_ptr<_Yp>&& __r) noexcept
      |         ^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:446:9: note:   template argument deduction/substitution failed:
src/main.cpp:255:108: note:   mismatched types 'std::shared_ptr<_Tp>' and 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'}
  255 | RemovedHandle = HyprlandAPI::registerCallbackDynamic(PHANDLE, "monitorRemoved", refreshMapping);
      |                                                                                               ^

/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:454:9: note: candidate: 'template<class _Yp, class _Del> std::shared_ptr<_Tp>::_Assignable<std::unique_ptr<_Up, _Ep> > std::shared_ptr<_Tp>::operator=(std::unique_ptr<_Up, _Ep>&&) [with _Del = _Yp; _Tp = std::function<void(void*, SCallbackInfo&, std::any)>]'
  454 |         operator=(unique_ptr<_Yp, _Del>&& __r)
      |         ^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:454:9: note:   template argument deduction/substitution failed:
src/main.cpp:255:108: note:   mismatched types 'std::unique_ptr<_Tp, _Dp>' and 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'}
  255 | RemovedHandle = HyprlandAPI::registerCallbackDynamic(PHANDLE, "monitorRemoved", refreshMapping);
      |                                                                                               ^

/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:414:19: note: candidate: 'std::shared_ptr<_Tp>& std::shared_ptr<_Tp>::operator=(const std::shared_ptr<_Tp>&) [with _Tp = std::function<void(void*, SCallbackInfo&, std::any)>]'
  414 |       shared_ptr& operator=(const shared_ptr&) noexcept = default;
      |                   ^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:414:29: note:   no known conversion for argument 1 from 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'} to 'const std::shared_ptr<std::function<void(void*, SCallbackInfo&, std::any)> >&'
  414 |       shared_ptr& operator=(const shared_ptr&) noexcept = default;
      |                             ^~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:438:7: note: candidate: 'std::shared_ptr<_Tp>& std::shared_ptr<_Tp>::operator=(std::shared_ptr<_Tp>&&) [with _Tp = std::function<void(void*, SCallbackInfo&, std::any)>]'
  438 |       operator=(shared_ptr&& __r) noexcept
      |       ^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:438:30: note:   no known conversion for argument 1 from 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'} to 'std::shared_ptr<std::function<void(void*, SCallbackInfo&, std::any)> >&&'
  438 |       operator=(shared_ptr&& __r) noexcept
      |                 ~~~~~~~~~~~~~^~~
src/main.cpp:256:116: error: no match for 'operator=' (operand types are 'std::shared_ptr<std::function<void(void*, SCallbackInfo&, std::any)> >' and 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'})
  256 | andle = HyprlandAPI::registerCallbackDynamic(PHANDLE, "configReloaded", configReloadedCallback);
      |                                                                                               ^

/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:418:9: note: candidate: 'template<class _Yp> std::shared_ptr<_Tp>::_Assignable<const std::shared_ptr<_Yp>&> std::shared_ptr<_Tp>::operator=(const std::shared_ptr<_Yp>&) [with _Tp = std::function<void(void*, SCallbackInfo&, std::any)>]'
  418 |         operator=(const shared_ptr<_Yp>& __r) noexcept
      |         ^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:418:9: note:   template argument deduction/substitution failed:
src/main.cpp:256:116: note:   mismatched types 'const std::shared_ptr<_Tp>' and 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'}
  256 | andle = HyprlandAPI::registerCallbackDynamic(PHANDLE, "configReloaded", configReloadedCallback);
      |                                                                                               ^

/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:429:9: note: candidate: 'template<class _Yp> std::shared_ptr<_Tp>::_Assignable<std::auto_ptr<_Up> > std::shared_ptr<_Tp>::operator=(std::auto_ptr<_Up>&&) [with _Tp = std::function<void(void*, SCallbackInfo&, std::any)>]'
  429 |         operator=(auto_ptr<_Yp>&& __r)
      |         ^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:429:9: note:   template argument deduction/substitution failed:
src/main.cpp:256:116: note:   mismatched types 'std::auto_ptr<_Up>' and 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'}
  256 | andle = HyprlandAPI::registerCallbackDynamic(PHANDLE, "configReloaded", configReloadedCallback);
      |                                                                                               ^

/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:446:9: note: candidate: 'template<class _Yp> std::shared_ptr<_Tp>::_Assignable<std::shared_ptr<_Yp> > std::shared_ptr<_Tp>::operator=(std::shared_ptr<_Yp>&&) [with _Tp = std::function<void(void*, SCallbackInfo&, std::any)>]'
  446 |         operator=(shared_ptr<_Yp>&& __r) noexcept
      |         ^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:446:9: note:   template argument deduction/substitution failed:
src/main.cpp:256:116: note:   mismatched types 'std::shared_ptr<_Tp>' and 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'}
  256 | andle = HyprlandAPI::registerCallbackDynamic(PHANDLE, "configReloaded", configReloadedCallback);
      |                                                                                               ^

/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:454:9: note: candidate: 'template<class _Yp, class _Del> std::shared_ptr<_Tp>::_Assignable<std::unique_ptr<_Up, _Ep> > std::shared_ptr<_Tp>::operator=(std::unique_ptr<_Up, _Ep>&&) [with _Del = _Yp; _Tp = std::function<void(void*, SCallbackInfo&, std::any)>]'
  454 |         operator=(unique_ptr<_Yp, _Del>&& __r)
      |         ^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:454:9: note:   template argument deduction/substitution failed:
src/main.cpp:256:116: note:   mismatched types 'std::unique_ptr<_Tp, _Dp>' and 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'}
  256 | andle = HyprlandAPI::registerCallbackDynamic(PHANDLE, "configReloaded", configReloadedCallback);
      |                                                                                               ^

/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:414:19: note: candidate: 'std::shared_ptr<_Tp>& std::shared_ptr<_Tp>::operator=(const std::shared_ptr<_Tp>&) [with _Tp = std::function<void(void*, SCallbackInfo&, std::any)>]'
  414 |       shared_ptr& operator=(const shared_ptr&) noexcept = default;
      |                   ^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:414:29: note:   no known conversion for argument 1 from 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'} to 'const std::shared_ptr<std::function<void(void*, SCallbackInfo&, std::any)> >&'
  414 |       shared_ptr& operator=(const shared_ptr&) noexcept = default;
      |                             ^~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:438:7: note: candidate: 'std::shared_ptr<_Tp>& std::shared_ptr<_Tp>::operator=(std::shared_ptr<_Tp>&&) [with _Tp = std::function<void(void*, SCallbackInfo&, std::any)>]'
  438 |       operator=(shared_ptr&& __r) noexcept
      |       ^~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:438:30: note:   no known conversion for argument 1 from 'HOOK_CALLBACK_FN*' {aka 'std::function<void(void*, SCallbackInfo&, std::any)>*'} to 'std::shared_ptr<std::function<void(void*, SCallbackInfo&, std::any)> >&&'
  438 |       operator=(shared_ptr&& __r) noexcept
      |                 ~~~~~~~~~~~~~^~~
make: *** [Makefile:44: split-monitor-workspaces.so] Error 1

failed to build

gentoo
jq: parse error: Invalid numeric literal at line 1, column 28 jq: parse error: Invalid numeric literal at line 1, column 28 Hyprland headers found. Building with XWayland support. g++ -shared -g -fPIC --no-gnu-unique -std=c++23 pkg-config --cflags pixman-1 libdrm hyprland -Iinclude -DWLR_USE_UNSTABLE src/main.cpp -o split-monitor-workspaces.so In file included from /usr/include/hyprland/src/defines.hpp:3, from /usr/include/hyprland/src/managers/KeybindManager.hpp:3, from src/main.cpp:2: /usr/include/hyprland/src/includes.hpp:107:10: fatal error: wlr/types/wlr_cursor_shape_v1.h: No such file or directory 107 | #include <wlr/types/wlr_cursor_shape_v1.h> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:48: split-monitor-workspaces.so] Error 1
wlroots 0.16.2
hyprland 0.28.0
hyprlandCrashReport5761.txt

Fails to compile when installed with hyprpm

FAILED: libsplit-monitor-workspaces.so.p/src_main.cpp.o
sccache c++ -Ilibsplit-monitor-workspaces.so.p -I. -I.. -I../include -I/home/lesnake/.local/share/hyprpm/headersRoot/include/hyprland/protocols -I/home/lesnake/.local/share/hyprpm/headersRoot
/include/hyprland/wlroots -I/home/lesnake/.local/share/hyprpm/headersRoot/include -I/usr/include/pixman-1 -I/usr/include/libdrm -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winval
id-pch -O3 -std=c++23 -DWLR_USE_UNSTABLE -fPIC -MD -MQ libsplit-monitor-workspaces.so.p/src_main.cpp.o -MF libsplit-monitor-workspaces.so.p/src_main.cpp.o.d -o libsplit-monitor-workspaces.so.
p/src_main.cpp.o -c ../src/main.cpp
../src/main.cpp: In function ‘void mapWorkspacesToMonitors()’:
../src/main.cpp:125:45: error: ‘Hyprlang’ has not been declared
  125 |     static auto* const workspaceCountPtr = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, k_workspaceCount)->getDataStaticPtr();
      |                                             ^~~~~~~~
../src/main.cpp:125:60: error: expected primary-expression before ‘const’
  125 |     static auto* const workspaceCountPtr = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, k_workspaceCount)->getDataStaticPtr();
      |                                                            ^~~~~
../src/main.cpp:125:59: error: expected ‘)’ before ‘const’
  125 |     static auto* const workspaceCountPtr = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, k_workspaceCount)->getDataStaticPtr();
      |                                            ~              ^~~~~~
      |                                                           )
../src/main.cpp:126:42: error: ‘Hyprlang’ has not been declared
  126 |     static auto* const keepFocusedPtr = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, k_keepFocused)->getDataStaticPtr();
      |                                          ^~~~~~~~
../src/main.cpp:126:57: error: expected primary-expression before ‘const’
  126 |     static auto* const keepFocusedPtr = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, k_keepFocused)->getDataStaticPtr();
      |                                                         ^~~~~
../src/main.cpp:126:56: error: expected ‘)’ before ‘const’
  126 |     static auto* const keepFocusedPtr = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, k_keepFocused)->getDataStaticPtr();
      |                                         ~              ^~~~~~
      |                                                        )
../src/main.cpp: In function ‘PLUGIN_DESCRIPTION_INFO pluginInit(void*)’:
../src/main.cpp:170:60: error: ‘Hyprlang’ has not been declared
  170 |     HyprlandAPI::addConfigValue(PHANDLE, k_workspaceCount, Hyprlang::INT{10});
      |                                                            ^~~~~~~~
../src/main.cpp:171:57: error: ‘Hyprlang’ has not been declared
  171 |     HyprlandAPI::addConfigValue(PHANDLE, k_keepFocused, Hyprlang::INT{0});
      |                                                         ^~~~~~~~
ninja: build stopped: subcommand failed.

crash when loading.

so i was setting up hyprload to finally autoupdate plugins and it was crashing. i gave up and switched back to just using this and it turns out the build i had been using of this repo is now somehow broken. the only thing that changed was me fixing seatd socket perms but even with logind backend its broken. i can provide any logs if needed but for some reason it doesnt coredump or really crash at all. it just exits

crash on nixos

im running this on a flake-homemanager setup.
i suppose it's because im running an overlay through the latest build?

error: builder for '/nix/store/xj179i5x5drhhirj6xgcns9nd90c6km4-split-monitor-workspaces-0.1.drv' failed with exit code 1;
       last 10 log lines:
       > Running phase: buildPhase
       > build flags: -j4
       > [1/2] Compiling C++ object libsplit-monitor-workspaces.so.p/src_main.cpp.o
       > FAILED: libsplit-monitor-workspaces.so.p/src_main.cpp.o
       > g++ -Ilibsplit-monitor-workspaces.so.p -I. -I.. -I../include -I/nix/store/gmx8cv2sbkhv2m827ldkgl6zl5cw5l8f-hyprland-0.37.1+date=2024-03-29_53aa184-dev/include -I/nix/store/gmx8cv2sbkhv2m827ldkgl6zl5cw5l8f-hyprland-0.37.1+date=2024-03-29_53aa184-dev/include/hyprland/protocols -I/nix/store/gmx8cv2sbkhv2m827ldkgl6zl5cw5l8f-hyprland-0.37.1+date=2024-03-29_53aa184-dev/include/hyprland/wlroots -I/nix/store/aldmf9w7jiss99b93dfndd1nsb9s5qn7-pixman-0.43.4/include/pixman-1 -I/nix/store/bf9ay9lix3w9830i65a4pvwjznx3ggc5-libdrm-2.4.120-dev/include -I/nix/store/bf9ay9lix3w9830i65a4pvwjznx3ggc5-libdrm-2.4.120-dev/include/libdrm -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++23
 -DWLR_USE_UNSTABLE -fPIC -MD -MQ libsplit-monitor-workspaces.so.p/src_main.cpp.o -MF libsplit-monitor-workspaces.so.p/src_main.cpp.o.d -o libsplit-monitor-workspaces.so.p/src_main.cpp.o -c ../src/main.cpp
       > ../src/main.cpp:6:10: fatal error: hyprland/src/helpers/Workspace.hpp: No such file or directory
       >     6 | #include <hyprland/src/helpers/Workspace.hpp>
       >       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       > compilation terminated.
       > ninja: build stopped: subcommand failed.
       For full logs, run 'nix log /nix/store/xj179i5x5drhhirj6xgcns9nd90c6km4-split-monitor-workspaces-0.1.drv'.
error: 1 dependencies of derivation '/nix/store/ag8i7lnasspc6yjd7qqprf7w984smw89-hm_hyprhyprland.conf.drv' failed to build
error: 1 dependencies of derivation '/nix/store/f4k6h36dwwfp0ib5shc5frn01bzhaji4-activation-script.drv' failed to build
error: 1 dependencies of derivation '/nix/store/k2klq770qf00f7dn5il5x2hpk9b4vpkx-home-manager-generation.drv' failed to build

Master monitor

How do I can install a master monitor? Because now, when I start hyprland programs in autostart open on my second monitor.

Hyprland Crashes on Startup When Attempting To Load split-monitor-workspaces

Hyprland Crashes With Seg Fault When being started with split-monitor-workspaces through hyprload

  • Crashing began after recent update
  • Receives "Getting Dispatcher!" and failure to start Xwayland in terminal
  • hyprland crash report log has [LOG] [hyprload] Loading plugin: split-monitor-workspaces.so as last action before crash
  • Hyprland launches without issue when hyprload not auto started

NixOs: Error: Failed to load plugin

Hi!

I'm using NixOs and I want to use this plugin in my Hyprland.

After installing my plugin with Home-manager it shows that error:
image

Can you help me please?

Here is my flake.nix (string "username" is changed with my actual user name):

{
  description = "A very basic flake";
  
  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";
    split-monitor-workspaces = {
      url = "github:Duckonaut/split-monitor-workspaces";
      inputs.hyprland.follows = "hyprland";
    };
  
  };
  
  outputs = {
    self,
    nixpkgs,
    hyprland,
    home-manager,
    split-monitor-workspaces,
    ...
  }@inputs: 
  
  let
    system = "x86_64-linux";
    pkgs = import nixpkgs {
      inherit system split-monitor-workspaces;
      config = {
        allowUnfree = true;
      };
    };
  
  in
  {
    nixosConfigurations = {
      nixos = nixpkgs.lib.nixosSystem {
        inherit system;
        specialArgs = { inherit inputs system split-monitor-workspaces; };
        
        modules = [
          ./nixos/configuration.nix
          
          home-manager.nixosModules.home-manager
          {
            home-manager = {
              extraSpecialArgs = { inherit system hyprland split-monitor-workspaces; };
              useGlobalPkgs = true;
              useUserPackages = true;
              
              users.username = {
                programs.home-manager.enable = true;
                home.stateVersion = "23.11"; # Please read the comment before changing.
                home.username = "username";
                home.homeDirectory = "/home/username";
                
                wayland.windowManager.hyprland = {
                  enable = true;
                  
                  plugins = [
                    split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces
                  ];
                
                  extraConfig = ''
                    plugin {
                      split-monitor-workspaces {
                        count = 5
                      }
                    }
                    # my hyprland config
                  '';
                };
              };
            
            };
          }
        ];
      
      };
    };
  };
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.