From 9e2ab640fd2b9dc5882352687dc098388a5aa0d6 Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Tue, 1 Oct 2024 16:08:11 +0200 Subject: [PATCH] hyprland: add hy3 --- flake.nix | 8 +++++- modules/wms/wayland/hyprland/binds.nix | 33 ++++++++++++++++------- modules/wms/wayland/hyprland/module.nix | 2 ++ modules/wms/wayland/hyprland/settings.nix | 1 + 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index cecb1d8..37a7409 100644 --- a/flake.nix +++ b/flake.nix @@ -26,7 +26,7 @@ }; # Hyprland, my main compositor - hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; + hyprland.url = "github:hyprwm/Hyprland"; # Plugins for hyprland hyprland-plugins = { @@ -40,6 +40,12 @@ inputs.hyprland.follows = "hyprland"; }; + # much better than sway + hy3 = { + url = "github:outfoxxed/hy3"; + inputs.hyprland.follows = "hyprland"; + }; + # Treefmt provides formatting for all files in my flake. treefmt-nix.url = "github:numtide/treefmt-nix"; diff --git a/modules/wms/wayland/hyprland/binds.nix b/modules/wms/wayland/hyprland/binds.nix index e6c72dd..711b222 100644 --- a/modules/wms/wayland/hyprland/binds.nix +++ b/modules/wms/wayland/hyprland/binds.nix @@ -27,18 +27,25 @@ in { workspace = toString i; in "$mainMod SHIFT, ${key}, split-movetoworkspacesilent, ${workspace}" ) (genList (i: i + 1) 10) + ++ map ( + i: let + mod = a: b: a - (b * (a / b)); + key = toString (mod i 10); + index = toString i; + in "$mainMod CONTROL, ${key}, hy3:focustab, index, ${index}" + ) (genList (i: i + 1) 10) ++ [ "$mainMod, RETURN, exec, ${pkgs.foot}/bin/foot" - "$mainMod, Q, killactive" + "$mainMod, Q, hy3:killactive" "$mainMod, F, fullscreen, 0" "$mainMod, D, exec, ${pkgs.procps}/bin/pkill fuzzel || ${pkgs.fuzzel}/bin/fuzzel" "$mainMod, SPACE, togglefloating, active" # Move Windows - "$mainMod SHIFT, H, movewindow, l" - "$mainMod SHIFT, J, movewindow, d" - "$mainMod SHIFT, K, movewindow, u" - "$mainMod SHIFT, L, movewindow, r" + "$mainMod SHIFT, H, hy3:movewindow, l, once" + "$mainMod SHIFT, J, hy3:movewindow, d, once" + "$mainMod SHIFT, K, hy3:movewindow, u, once" + "$mainMod SHIFT, L, hy3:movewindow, r, once" # Screenshotting "$mainMod, S, exec, ${pkgs.grimblast}/bin/grimblast copy area" @@ -56,14 +63,22 @@ in { # Restart waybar "$mainMod CONTROL, B, exec, ${pkgs.procps}/bin/pkill waybar || ${pkgs.waybar}/bin/waybar" + + # hy3 group settings + "$mainMod, Z, hy3:makegroup, h" + "$mainMod SHIFT, Z, hy3:makegroup, v" + "$mainMod, U, hy3:makegroup, tab" + "$mainMod, A, hy3:changefocus, raise" + "$mainMod SHIFT, A, hy3:changefocus, lower" + "$mainMod, C, hy3:changegroup, opposite" ]; binde = [ # window focus - "$mainMod, H, movefocus, l" - "$mainMod, J, movefocus, d" - "$mainMod, K, movefocus, u" - "$mainMod, L, movefocus, r" + "$mainMod, H, hy3:movefocus, l" + "$mainMod, J, hy3:movefocus, d" + "$mainMod, K, hy3:movefocus, u" + "$mainMod, L, hy3:movefocus, r" ]; # Media controls diff --git a/modules/wms/wayland/hyprland/module.nix b/modules/wms/wayland/hyprland/module.nix index 2f1b287..25099cc 100644 --- a/modules/wms/wayland/hyprland/module.nix +++ b/modules/wms/wayland/hyprland/module.nix @@ -11,6 +11,7 @@ (inputs'.split-monitor-workspaces.packages) split-monitor-workspaces ; + inherit (inputs'.hy3.packages) hy3; inherit (lib) mkIf mkDefault; in { imports = [ @@ -51,6 +52,7 @@ in { # Split-monitor-workspaces provides awesome-like workspace behaviour plugins = [ split-monitor-workspaces + hy3 ]; # Xwayland for X applications diff --git a/modules/wms/wayland/hyprland/settings.nix b/modules/wms/wayland/hyprland/settings.nix index 37d3ab1..91e7f22 100644 --- a/modules/wms/wayland/hyprland/settings.nix +++ b/modules/wms/wayland/hyprland/settings.nix @@ -47,6 +47,7 @@ in { }; general = { + layout = "hy3"; gaps_in = 0; gaps_out = 0; border_size = 2;