diff --git a/apps/hyprland/default.nix b/apps/hyprland/default.nix index d5f92fa..a721d2d 100644 --- a/apps/hyprland/default.nix +++ b/apps/hyprland/default.nix @@ -1,4 +1,4 @@ -{ +{pkgs, ...}: { imports = [ ./hypr/binds.nix ./hypr/general.nix @@ -12,4 +12,7 @@ ]; wayland.windowManager.hyprland.enable = true; wayland.windowManager.hyprland.systemd.enable = false; # for UWSM support... + wayland.windowManager.hyprland.plugins = [ + pkgs.hyprlandPlugins.hyprsplit + ]; } diff --git a/apps/hyprland/hypr/binds.nix b/apps/hyprland/hypr/binds.nix index 96e9395..92badf4 100644 --- a/apps/hyprland/hypr/binds.nix +++ b/apps/hyprland/hypr/binds.nix @@ -71,22 +71,18 @@ "SUPER, Tab, Cycle workspaces, workspace, previous" ] ++ ( - # Generate binds for Super + [1-10] to switch workspaces - # and Super + Shift + [1-10] to move window to workspace + # Generate binds for Super + [1-5] to switch workspaces on current monitor + # and Super + Shift + [1-5] to move window to workspace on current monitor builtins.concatLists (builtins.genList ( i: let ws = i + 1; - key = toString ( - if ws == 10 - then 0 - else ws - ); + key = toString ws; in [ - "SUPER, ${key}, Switch to workspace ${toString ws}, exec, hakase-workspace-switch-force ${toString ws}" - "SUPER SHIFT, ${key}, Move window to workspace ${toString ws}, movetoworkspace, ${toString ws}" + "SUPER, ${key}, Switch to workspace ${toString ws}, split:workspace, ${toString ws}" + "SUPER SHIFT, ${key}, Move window to workspace ${toString ws}, split:movetoworkspace, ${toString ws}" ] ) - 10) + 5) ); }; } diff --git a/apps/hyprland/hypr/exec.nix b/apps/hyprland/hypr/exec.nix index 204d6b2..709700e 100644 --- a/apps/hyprland/hypr/exec.nix +++ b/apps/hyprland/hypr/exec.nix @@ -8,6 +8,7 @@ "killall -SIGUSR2 .ghostty-wrappe" ]; exec-once = [ + "hyprpm reload -n" "[workspace special:preload silent] uwsm app -- firefox" "[workspace special:preload silent] uwsm app -- firefox -P YouTube" "[workspace special:preload silent] uwsm app -- xdg-terminal-exec" diff --git a/apps/hyprland/hypr/misc.nix b/apps/hyprland/hypr/misc.nix index 033b115..58f23e2 100644 --- a/apps/hyprland/hypr/misc.nix +++ b/apps/hyprland/hypr/misc.nix @@ -18,5 +18,12 @@ direct_scanout = true; cm_enabled = true; }; + + plugin = { + hyprsplit = { + num_workspaces = 5; + persistent_workspaces = false; + }; + }; }; } diff --git a/flake.lock b/flake.lock index e4cc249..d5a3124 100644 --- a/flake.lock +++ b/flake.lock @@ -333,11 +333,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1766498696, - "narHash": "sha256-74qO6ynwUav+QqNhBVn/4yoBCpU6r3/eCkX/V11uL+E=", + "lastModified": 1767201430, + "narHash": "sha256-4BUM06GqP5YAVnWvxkdeYuweMF6n+oKdxJI5S9TmA1E=", "ref": "refs/heads/main", - "rev": "f7f357f15f83612078eb0919ca08b71cac01c25e", - "revCount": 6741, + "rev": "48a024e0322bbd7c4c88126498ec478444ec4cb2", + "revCount": 6763, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -448,6 +448,26 @@ "type": "github" } }, + "hyprsplit": { + "inputs": { + "hyprland": [ + "hyprland" + ] + }, + "locked": { + "lastModified": 1766546378, + "narHash": "sha256-GSoSLHErh1mRfgXM57W98L67MMBHKCemHzxoZPrejSI=", + "owner": "shezdy", + "repo": "hyprsplit", + "rev": "9a8b55f4269bfa5c59d03ed9f4502f433572c616", + "type": "github" + }, + "original": { + "owner": "shezdy", + "repo": "hyprsplit", + "type": "github" + } + }, "hyprtoolkit": { "inputs": { "aquamarine": [ @@ -764,6 +784,7 @@ "elephant": "elephant", "home-manager": "home-manager_2", "hyprland": "hyprland", + "hyprsplit": "hyprsplit", "nixovim": "nixovim", "nixpkgs": "nixpkgs_2", "nur": "nur", diff --git a/flake.nix b/flake.nix index 3573f52..b55c39b 100644 --- a/flake.nix +++ b/flake.nix @@ -27,6 +27,10 @@ url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; inputs.nixpkgs.follows = "nixpkgs"; }; + hyprsplit = { + url = "github:shezdy/hyprsplit"; + inputs.hyprland.follows = "hyprland"; + }; nixovim = { # FIXME: treesitter does not install automatically (disabled due to read-only problems) url = "git+https://git.sakamoto.dev/kenji/nixovim.git";