From b0992484898d1876627def170cc5a13b95cbca29 Mon Sep 17 00:00:00 2001 From: Danilo Reyes Date: Sun, 28 Sep 2025 17:16:43 -0600 Subject: [PATCH] hyprland bindings --- environments/hyprland.nix | 79 ++++++++++++++++++++++++++++++++++----- 1 file changed, 69 insertions(+), 10 deletions(-) diff --git a/environments/hyprland.nix b/environments/hyprland.nix index 4a25d38..473cbed 100644 --- a/environments/hyprland.nix +++ b/environments/hyprland.nix @@ -4,7 +4,6 @@ ... }: let - # ${pkgs.swww}/bin/swww img ${./wallpaper.png} & startupScript = pkgs.pkgs.writeShellScriptBin "start" '' ${pkgs.waybar}/bin/waybar & ${pkgs.swww}/bin/swww init & @@ -12,9 +11,7 @@ let ''; in { - programs.hyprland = { - enable = true; - }; + programs.hyprland.enable = true; services.greetd = { enable = true; settings.default_session = { @@ -24,7 +21,10 @@ in }; xdg.portal = { enable = true; - extraPortals = [ pkgs.xdg-desktop-portal-hyprland pkgs.xdg-desktop-portal-gtk ]; + extraPortals = [ + pkgs.xdg-desktop-portal-hyprland + pkgs.xdg-desktop-portal-gtk + ]; }; users.users.jawz.packages = builtins.attrValues { inherit (pkgs) @@ -35,17 +35,76 @@ in slurp wofi # Application launcher - kitty # Terminal mako # Notification daemon libnotify # dependency of mako swaylock-effects # Screen locker nautilus # File manager ; }; - home-manager.users.jawz.wayland.windowManager.hyprland = { - enable = true; - settings = { - exec-once = "${startupScript}/bin/start"; + home-manager.users.jawz = { + programs.kitty.enable = true; + wayland.windowManager.hyprland = { + enable = true; + settings = { + "$mainMod" = "SUPER"; + exec-once = "${startupScript}/bin/start"; + general = { + gaps_in = 5; + gaps_out = 10; + border_size = 2; + layout = "dwindle"; + }; + dwindle = { + pseudotile = true; + preserve_split = true; + force_split = 2; + }; + bind = [ + "$mainMod, return, exec, kitty" + "$mainMod, Q, killactive," + "$mainMod SHIFT, F, togglefloating," + "$mainMod, F, fullscreen," + "$mainMod, T, pin," + "$mainMod, G, togglegroup," + "$mainMod, bracketleft, changegroupactive, b" + "$mainMod, bracketright, changegroupactive, f" + "$mainMod, S, exec, wofi --show drun icons" + "$mainMod, P, pin, active" + + ",XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%+" + ",XF86AudioLowerVolume, exec, wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%-" + + "$mainMod, left, movefocus, l" + "$mainMod, right, movefocus, r" + "$mainMod, up, movefocus, u" + "$mainMod, down, movefocus, d" + + "$mainMod, h, movefocus, l" + "$mainMod, l, movefocus, r" + "$mainMod, k, movefocus, u" + "$mainMod, j, movefocus, d" + + "$mainMod SHIFT, h, movewindow, l" + "$mainMod SHIFT, l, movewindow, r" + "$mainMod SHIFT, k, movewindow, u" + "$mainMod SHIFT, j, movewindow, d" + ]; + binde = [ + "$mainMod SHIFT, h, moveactive, -20 0" + "$mainMod SHIFT, l, moveactive, 20 0" + "$mainMod SHIFT, k, moveactive, 0 -20" + "$mainMod SHIFT, j, moveactive, 0 20" + + "$mainMod CTRL, l, resizeactive, 30 0" + "$mainMod CTRL, h, resizeactive, -30 0" + "$mainMod CTRL, k, resizeactive, 0 -10" + "$mainMod CTRL, j, resizeactive, 0 10" + ]; + bindm = [ + "$mainMod, mouse:272, movewindow" + "$mainMod, mouse:273, resizewindow" + ]; + }; }; }; }