summaryrefslogtreecommitdiff
path: root/home-manager/compositor/hyprland.nix
blob: e3fff5e9adf39cd7d4c5854df4298aa68381d728 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
{ pkgs, config, ... }:
{
  wayland.windowManager.hyprland.enable = true;
  wayland.windowManager.hyprland.systemd.enable = true;
  wayland.windowManager.hyprland.settings = {
    "$terminal" = "alacritty";
    "$mod" = "SUPER";

    exec-once = [
      "waybar"
    ];

    debug = {
      "disable_logs" = false;
    };

    general = {
      "border_size" = 2;
      "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
      "col.inactive_border" = "rgba(595959aa)";
    };

    monitor = [
      "Unknown-1, disable"
      ",preferred,auto,auto"
    ];

    animations = {
      bezier = [
        "easeOutQuint,0.23,1,0.32,1"
        "easeInOutCubic,0.65,0.05,0.36,1"
        "linear,0,0,1,1"
        "almostLinear,0.5,0.5,0.75,1.0"
        "quick,0.15,0,0.1,1"
      ];
      animation = [
        "global, 1, 10, default"
        "border, 1, 5.39, easeOutQuint"
        "windows, 1, 4.79, easeOutQuint"
        "windowsIn, 1, 4.1, easeOutQuint, popin 87%"
        "windowsOut, 1, 1.49, linear, popin 87%"
        "fadeIn, 1, 1.73, almostLinear"
        "fadeOut, 1, 1.46, almostLinear"
        "fade, 1, 3.03, quick"
        "layers, 1, 3.81, easeOutQuint"
        "layersIn, 1, 4, easeOutQuint, fade"
        "layersOut, 1, 1.5, linear, fade"
        "fadeLayersIn, 1, 1.79, almostLinear"
        "fadeLayersOut, 1, 1.39, almostLinear"
        "workspaces, 1, 1.94, almostLinear, fade"
      ];
    };

    decoration = {
      "rounding" = 5;
      "inactive_opacity" = 0.8;
    };

    bind =
      [
        "$mod, D, exec, ${pkgs.rofi-wayland-unwrapped}/bin/rofi -show drun"
        "$mod SHIFT, D, exec, ${pkgs.rofi-rbw-wayland}/bin/rofi-rbw"
        "$mod, F, fullscreen, 1"
        "$mod, Return, exec, alacritty"
        "$mod SHIFT, Q, killactive"
        "$mod, h, movefocus, l"
        "$mod, j, movefocus, d"
        "$mod, k, movefocus, u"
        "$mod, l, movefocus, r"
        "$mod SHIFT, h, swapwindow, l"
        "$mod SHIFT, j, swapwindow, d"
        "$mod SHIFT, k, swapwindow, u"
        "$mod SHIFT, l, swapwindow, r"
      ]
      ++ (
        builtins.concatLists (builtins.genList (i:
          let ws = i + 1;
          in [
            "$mod, code:1${toString i}, workspace, ${toString ws}"
            "$mod SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}"
          ]
        )
      9)
    );
  };

  programs.waybar.enable = true;
  programs.waybar.settings = {
    mainBar = {
      layer = "top";
      position = "bottom";
      output = [
        "HDMI-A-1"
      ];
      modules-left = [
        "hyprland/workspaces"
      ];
      modules-right = [
        "clock"
      ];

      "hyprland/workspaces" = {
        all-outputs = true;
        format-icons = {
          active = "";
          default = "";
        };
        format = "{id} {icon}";
        window-rewrite-default = "*";
      };
    };
  };

  services.hyprpaper.enable = true;
  services.hyprpaper.settings =
  let
    p = "${config.home.homeDirectory}/Pictures";
    mac-color-4k = "${p}/mac-mac-color-4k.jpg";
    poly = "${p}/poly-8k.jpg";
    default = "${poly}";
  in
  {
    preload = [
      "${default}"
    ];
    wallpaper = [
      ",${default}"
    ];
  };
}