dot

NixOS dotfiles
git clone https://git.echoz.io/dot.git
Log | Files | Refs

hyprland.nix (6665B)


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