hyprland.nix (6658B)
1 { 2 lib, 3 pkgs, 4 5 style, 6 user, 7 ... 8 }: 9 { 10 programs.hyprland = { 11 enable = true; 12 xwayland.enable = true; 13 withUWSM = true; 14 }; 15 16 home-manager.users.${user} = 17 { config, ... }: 18 { 19 wayland.windowManager.hyprland = { 20 enable = true; 21 package = null; 22 portalPackage = null; 23 configType = "hyprlang"; 24 settings = { 25 monitor = [ ",preferred,auto,1" ]; 26 27 input = { 28 kb_layout = "us"; 29 kb_options = "compose:ralt,caps:escape"; 30 follow_mouse = 1; 31 touchpad.natural_scroll = false; 32 sensitivity = 0; 33 accel_profile = "flat"; 34 }; 35 36 general = { 37 gaps_in = 5; 38 gaps_out = 10; 39 border_size = 0; 40 "col.active_border" = "rgba(00000000) ${style.colors.fg.rgbaHex} rgba(00000000) 45deg"; 41 "col.inactive_border" = "rgba(00000000)"; 42 layout = "dwindle"; 43 }; 44 45 decoration = { 46 rounding = 10; 47 shadow.enabled = false; 48 blur = { 49 enabled = true; 50 size = 5; 51 passes = 3; 52 noise = 0.03333; 53 }; 54 dim_inactive = true; 55 dim_strength = 0.2; 56 dim_special = 0.2; 57 dim_around = 0.2; 58 }; 59 60 animations = { 61 enabled = lib.mkDefault true; 62 bezier = [ 63 "linear, 0, 0, 1, 1" 64 "easeOut, 0.42, 0, 0.58, 1" 65 "easeInOut, 0, 0, 0.58, 1" 66 "easeIn, 0.42, 0, 1, 1" 67 ]; 68 animation = [ 69 "windows, 1, 2, linear" 70 "windowsOut, 1, 2, linear" 71 # "border, 1, 2, linear" 72 # "borderangle, 1, 100, linear, loop" 73 "fade, 1, 2, linear" 74 "workspaces, 1, 2, linear" 75 ]; 76 }; 77 78 misc = { 79 disable_hyprland_logo = true; 80 disable_splash_rendering = true; 81 }; 82 83 ecosystem = { 84 no_donation_nag = true; 85 no_update_news = true; 86 }; 87 88 group = { 89 drag_into_group = 2; 90 merge_groups_on_drag = false; 91 "col.border_active" = "rgba(00000000) ${style.colors.fg.rgbaHex} rgba(00000000) 45deg"; 92 "col.border_inactive" = "rgba(00000000)"; 93 "col.border_locked_active" = "rgba(00000000) ${style.colors.fg.rgbaHex} rgba(00000000) 45deg"; 94 "col.border_locked_inactive" = "rgba(00000000)"; 95 96 groupbar = { 97 render_titles = true; 98 font_family = style.fonts.mono.family; 99 font_size = 16; 100 text_offset = 0; 101 gaps_in = 10; 102 gaps_out = 10; 103 keep_upper_gap = false; 104 height = 44; 105 indicator_height = 0; 106 gradients = true; 107 gradient_rounding = 10; 108 gradient_round_only_edges = false; 109 "col.active" = style.colors.bg.rgbaHex; 110 "col.inactive" = style.colors.bg.rgbaHex; 111 text_color = style.colors.fg.rgbaHex; 112 text_color_inactive = style.colors.lo.rgbaHex; 113 blur = true; 114 }; 115 }; 116 117 cursor = { 118 warp_on_change_workspace = 1; 119 }; 120 121 binds = { 122 workspace_center_on = 1; 123 }; 124 125 workspace = (builtins.genList (n: "${toString (n + 1)}, persistent:true") 9) ++ [ 126 "special:special, on-created-empty:[workspace special:special; float] ${pkgs.writeShellScript "init-empty-special-workspace" '' 127 settings=( 128 "--override" "initial_window_width=160c" 129 "--override" "initial_window_height=48c" 130 ) 131 uwsm app -- kitty "''${settings[@]}" btop 132 ''}" 133 ]; 134 135 "$mod" = lib.mkDefault "SUPER"; 136 137 bind = [ 138 "$mod, Q, killactive," 139 "$mod SHIFT, Q, forcekillactive," 140 "$mod SHIFT, Delete, exit," 141 "$mod, F, fullscreen, 0" 142 "$mod SHIFT, F, togglefloating," 143 "$mod CTRL, F, pseudo," 144 "$mod, G, togglegroup," 145 "$mod, N, changegroupactive,f" 146 "$mod, P, changegroupactive,b" 147 148 "$mod, h, movefocus, l" 149 "$mod, j, movefocus, d" 150 "$mod, k, movefocus, u" 151 "$mod, l, movefocus, r" 152 153 "$mod, 1, workspace, 1" 154 "$mod, 2, workspace, 2" 155 "$mod, 3, workspace, 3" 156 "$mod, 4, workspace, 4" 157 "$mod, 5, workspace, 5" 158 "$mod, 6, workspace, 6" 159 "$mod, 7, workspace, 7" 160 "$mod, 8, workspace, 8" 161 "$mod, 9, workspace, 9" 162 163 "$mod, Tab, togglespecialworkspace" 164 165 "$mod SHIFT, 1, movetoworkspacesilent, 1" 166 "$mod SHIFT, 2, movetoworkspacesilent, 2" 167 "$mod SHIFT, 3, movetoworkspacesilent, 3" 168 "$mod SHIFT, 4, movetoworkspacesilent, 4" 169 "$mod SHIFT, 5, movetoworkspacesilent, 5" 170 "$mod SHIFT, 6, movetoworkspacesilent, 6" 171 "$mod SHIFT, 7, movetoworkspacesilent, 7" 172 "$mod SHIFT, 8, movetoworkspacesilent, 8" 173 "$mod SHIFT, 9, movetoworkspacesilent, 9" 174 175 "$mod SHIFT, Tab, movetoworkspacesilent, special:special" 176 ]; 177 178 bindm = [ 179 "$mod, mouse:272, movewindow" 180 "$mod, mouse:273, resizewindow" 181 ]; 182 183 bindpunti = [ ", Alt_L, exec, ${lib.getExe pkgs.pamixer} --default-source --unmute" ]; 184 bindpuntir = [ ", Alt_L, exec, ${lib.getExe pkgs.pamixer} --default-source --mute" ]; 185 186 windowrule = [ 187 "animation popin 100%, match:group on" 188 "float on, match:workspace special:special" 189 "workspace 4 silent, match:class ^steam$" 190 "workspace 2 silent, match:class ^steam_app_[0-9]+$" 191 "workspace 5 silent, match:class ^firefox$" 192 "workspace 3 silent, match:class ^discord$" 193 "workspace 3 silent, match:class ^com.slack.Slack$" 194 "workspace 3 silent, match:class ^spotify$" 195 "workspace 3 silent, match:class ^org.signal.Signal$" 196 "workspace 5 silent, tile on, match:class ^steam_app_2694490" 197 ]; 198 }; 199 }; 200 201 xdg.configFile."uwsm/env".source = 202 "${config.home.sessionVariablesPackage}/etc/profile.d/hm-session-vars.sh"; 203 }; 204 }