nix-configs

Personal NixOS and home-manager configuration files
Log | Files | Refs

hyprland.nix (5697B)


      1 { ... }:
      2 
      3 {
      4   wayland.windowManager.hyprland = {
      5     enable = true;
      6     settings = {
      7 
      8       ecosystem = {
      9         "no_update_news" = true;
     10       };
     11 
     12       monitor = ",preferred,auto,auto";
     13       env = [
     14         "XCURSOR_SIZE,24"
     15         "HYPRCURSOR_SIZE,24"
     16       ];
     17 
     18       general = {
     19         gaps_in = 5;
     20         gaps_out = 20;
     21         border_size = 2;
     22         "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
     23         "col.inactive_border" = "rgba(595959aa)";
     24         resize_on_border = false;
     25         allow_tearing = false;
     26         layout = "dwindle";
     27       };
     28 
     29       cursor = {
     30         inactive_timeout = 3;
     31       };
     32 
     33       decoration = {
     34         rounding = 5;
     35         active_opacity = 1.0;
     36         inactive_opacity = 1.0;
     37         shadow = {
     38           enabled = true;
     39           range = 4;
     40           render_power = 3;
     41           color = "rgba(1a1a1aee)";
     42         };
     43         blur = {
     44           enabled = true;
     45           size = 3;
     46           passes = 1;
     47           vibrancy = 0.1696;
     48         };
     49       };
     50 
     51       animations = {
     52         enabled = true;
     53         bezier = [
     54           "easeOutQuint,0.23,1,0.32,1"
     55           "easeInOutCubic,0.65,0.05,0.36,1"
     56           "linear,0,0,1,1"
     57           "almostLinear,0.5,0.5,0.75,1.0"
     58           "quick,0.15,0,0.1,1"
     59         ];
     60         animation = [
     61           "global, 1, 10, default"
     62           "border, 1, 5.39, easeOutQuint"
     63           "windows, 1, 4.79, easeOutQuint"
     64           "windowsIn, 1, 4.1, easeOutQuint, popin 87%"
     65           "windowsOut, 1, 1.49, linear, popin 87%"
     66           "fadeIn, 1, 1.73, almostLinear"
     67           "fadeOut, 1, 1.46, almostLinear"
     68           "fade, 1, 3.03, quick"
     69           "layers, 1, 3.81, easeOutQuint"
     70           "layersIn, 1, 4, easeOutQuint, fade"
     71           "layersOut, 1, 1.5, linear, fade"
     72           "fadeLayersIn, 1, 1.79, almostLinear"
     73           "fadeLayersOut, 1, 1.39, almostLinear"
     74           "workspaces, 1, 1.94, almostLinear, fade"
     75           "workspacesIn, 1, 1.21, almostLinear, fade"
     76           "workspacesOut, 1, 1.94, almostLinear, fade"
     77         ];
     78       };
     79 
     80       dwindle = {
     81         pseudotile = true;
     82         preserve_split = true;
     83         workspace = [
     84           "w[tv1], gapsout:0, gapsin:0"
     85           "f[1], gapsout:0, gapsin:0"
     86         ];
     87         windowrulev2 = [
     88           "bordersize 0, floating:0, onworkspace:w[tv1]"
     89           "rounding 0, floating:0, onworkspace:w[tv1]"
     90           "bordersize 0, floating:0, onworkspace:f[1]"
     91           "rounding 0, floating:0, onworkspace:f[1]"
     92         ];
     93       };
     94 
     95       master = {
     96         new_status = "master";
     97       };
     98 
     99       misc = {
    100         force_default_wallpaper = 0;
    101         disable_hyprland_logo = true;
    102       };
    103 
    104       input = {
    105         kb_layout = "gb";
    106         kb_options = "caps:backspace";
    107         follow_mouse = 1;
    108         sensitivity = 0;
    109         touchpad = {
    110           natural_scroll = false;
    111         };
    112       };
    113 
    114       gestures = {
    115         workspace_swipe = false;
    116       };
    117 
    118       bind = [
    119         "SUPER, R, exec, tofi-drun | xargs hyprctl dispatch exec --"
    120         "SUPER, W, exec, firefox"
    121         "SUPER, T, exec, ghostty"
    122         "SUPER_SHIFT, W, exec, firefox -private-window"
    123         "ALT, Tab, cyclenext"
    124         "ALT SHIFT, Tab, cyclenext, prev"
    125         "SUPER, RETURN, exec, ghostty"
    126         "SUPER_SHIFT, Q, killactive,"
    127         "SUPER, X, exit,"
    128         "SUPER, E, exec, ghostty -e lf"
    129         "SUPER, Space, togglefloating,"
    130         "SUPER, F, fullscreen,"
    131         "SUPER, P, pseudo,"
    132         "SUPER, J, togglesplit,"
    133         "SUPER, left, movefocus, l"
    134         "SUPER, right, movefocus, r"
    135         "SUPER, up, movefocus, u"
    136         "SUPER, down, movefocus, d"
    137         "SUPER, 1, workspace, 1"
    138         "SUPER, 2, workspace, 2"
    139         "SUPER, 3, workspace, 3"
    140         "SUPER, 4, workspace, 4"
    141         "SUPER, 5, workspace, 5"
    142         "SUPER, 6, workspace, 6"
    143         "SUPER, 7, workspace, 7"
    144         "SUPER, 8, workspace, 8"
    145         "SUPER, 9, workspace, 9"
    146         "SUPER, 0, workspace, 10"
    147         "SUPER SHIFT, 1, movetoworkspace, 1"
    148         "SUPER SHIFT, 2, movetoworkspace, 2"
    149         "SUPER SHIFT, 3, movetoworkspace, 3"
    150         "SUPER SHIFT, 4, movetoworkspace, 4"
    151         "SUPER SHIFT, 5, movetoworkspace, 5"
    152         "SUPER SHIFT, 6, movetoworkspace, 6"
    153         "SUPER SHIFT, 7, movetoworkspace, 7"
    154         "SUPER SHIFT, 8, movetoworkspace, 8"
    155         "SUPER SHIFT, 9, movetoworkspace, 9"
    156         "SUPER SHIFT, 0, movetoworkspace, 10"
    157         "SUPER, mouse_down, workspace, e+1"
    158         "SUPER, mouse_up, workspace, e-1"
    159       ];
    160 
    161       bindm = [
    162         "ALT, mouse:272, movewindow"
    163         "ALT, mouse:273, resizewindow"
    164       ];
    165 
    166       bindel = [
    167         ",XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
    168         ",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
    169         ",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
    170         ",XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
    171         ",XF86MonBrightnessUp, exec, brightnessctl s 10%+"
    172         ",XF86MonBrightnessDown, exec, brightnessctl s 10%-"
    173       ];
    174 
    175       bindl = [
    176         ", XF86AudioNext, exec, playerctl next"
    177         ", XF86AudioPause, exec, playerctl play-pause"
    178         ", XF86AudioPlay, exec, playerctl play-pause"
    179         ", XF86AudioPrev, exec, playerctl previous"
    180       ];
    181 
    182       windowrulev2 = [
    183         "suppressevent maximize, class:.*"
    184         "nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0"
    185       ];
    186     };
    187   };
    188 
    189   programs.fish = {
    190     interactiveShellInit = ''
    191       set -gx HYPRPATH (whereis Hyprland | awk '{print $NF}')
    192       if test (tty) = "/dev/tty1"; exec $HYPRPATH; end
    193     '';
    194   };
    195 
    196   dconf = {
    197     enable = true;
    198   };
    199 }