hyprland.nix (6698B)
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] ${ 127 pkgs.writeShellScript "init-empty-special-workspace" '' 128 settings=( 129 "--override" "initial_window_width=160c" 130 "--override" "initial_window_height=48c" 131 ) 132 uwsm app -- kitty "''${settings[@]}" btop 133 '' 134 }" 135 ]; 136 137 "$mod" = lib.mkDefault "SUPER"; 138 139 bind = [ 140 "$mod, Q, killactive," 141 "$mod SHIFT, Q, forcekillactive," 142 "$mod SHIFT, Delete, exit," 143 "$mod, F, fullscreen, 0" 144 "$mod SHIFT, F, togglefloating," 145 "$mod CTRL, F, pseudo," 146 "$mod, G, togglegroup," 147 "$mod, N, changegroupactive,f" 148 "$mod, P, changegroupactive,b" 149 150 "$mod, h, movefocus, l" 151 "$mod, j, movefocus, d" 152 "$mod, k, movefocus, u" 153 "$mod, l, movefocus, r" 154 155 "$mod, 1, workspace, 1" 156 "$mod, 2, workspace, 2" 157 "$mod, 3, workspace, 3" 158 "$mod, 4, workspace, 4" 159 "$mod, 5, workspace, 5" 160 "$mod, 6, workspace, 6" 161 "$mod, 7, workspace, 7" 162 "$mod, 8, workspace, 8" 163 "$mod, 9, workspace, 9" 164 165 "$mod, Tab, togglespecialworkspace" 166 167 "$mod SHIFT, 1, movetoworkspacesilent, 1" 168 "$mod SHIFT, 2, movetoworkspacesilent, 2" 169 "$mod SHIFT, 3, movetoworkspacesilent, 3" 170 "$mod SHIFT, 4, movetoworkspacesilent, 4" 171 "$mod SHIFT, 5, movetoworkspacesilent, 5" 172 "$mod SHIFT, 6, movetoworkspacesilent, 6" 173 "$mod SHIFT, 7, movetoworkspacesilent, 7" 174 "$mod SHIFT, 8, movetoworkspacesilent, 8" 175 "$mod SHIFT, 9, movetoworkspacesilent, 9" 176 177 "$mod SHIFT, Tab, movetoworkspacesilent, special:special" 178 ]; 179 180 bindm = [ 181 "$mod, mouse:272, movewindow" 182 "$mod, mouse:273, resizewindow" 183 ]; 184 185 bindpunti = [ ", Alt_L, exec, ${lib.getExe pkgs.pamixer} --default-source --unmute" ]; 186 bindpuntir = [ ", Alt_L, exec, ${lib.getExe pkgs.pamixer} --default-source --mute" ]; 187 188 windowrule = [ 189 "animation popin 100%, match:group on" 190 "float on, match:workspace special:special" 191 "workspace 4 silent, match:class ^steam$" 192 "workspace 2 silent, match:class ^steam_app_[0-9]+$" 193 "workspace 5 silent, match:class ^firefox$" 194 "workspace 3 silent, match:class ^discord$" 195 "workspace 3 silent, match:class ^com.slack.Slack$" 196 "workspace 3 silent, match:class ^spotify$" 197 "workspace 3 silent, match:class ^org.signal.Signal$" 198 "workspace 5 silent, tile on, match:class ^steam_app_2694490" 199 ]; 200 }; 201 }; 202 203 xdg.configFile."uwsm/env".source = 204 "${config.home.sessionVariablesPackage}/etc/profile.d/hm-session-vars.sh"; 205 }; 206 }