A small Hyprland plugin to provide awesome-like workspace behavior
Find a file
2023-09-13 15:27:18 +02:00
include Change include paths 2023-05-08 12:31:15 +02:00
src post-PR fixes 2023-08-29 19:27:15 +02:00
.clang-format Initial commit 2023-02-28 00:58:50 +01:00
.gitignore nix: clean up flake and ignore nix build artifact 2023-08-30 14:31:55 +02:00
flake.lock flake: bump inputs 2023-09-13 15:27:18 +02:00
flake.nix nix: use gcc13 in the builder 2023-09-13 15:27:18 +02:00
hyprload.toml make meson default build system 2023-08-29 19:27:22 +02:00
LICENSE Add BSD license 2023-04-27 10:30:13 +02:00
Makefile chore: make install dir before copying 2023-06-04 23:14:13 +02:00
meson.build add meson build 2023-08-29 19:14:04 +02:00
README.md docs: include NixOS installation instructions in the README 2023-09-13 15:27:18 +02:00

split-monitor-workspaces

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

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 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

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

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.

Special thanks

  • hyprsome: An earlier project of similar nature