aboutsummaryrefslogtreecommitdiff
path: root/modules/user/desktop/sessions/sway.nix
blob: e853a10a63a6b54edbbba7760e71dcfe5c4540ff (plain) (blame)
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
{
  config,
  lib,
  options,
  ...
}:
{
  config = {
    wayland.windowManager.sway = {
      enable = lib.mkDefault config.desktop.sessions.sway.enable;
      config = {
        bars = [
          {
            colors = {
              activeWorkspace = {
                background = "#11111b";
                border = "#11111b";
                text = "#cdd6f4";
              };

              background = "#11111b";
              bindingMode = {
                background = "#a6e3a1";
                border = "#a6e3a1";
                text = "#11111b";
              };

              focusedBackground = "#11111b";
              focusedSeparator = "#a6adc8";
              focusedStatusline = "#cdd6f4";
              focusedWorkspace = {
                background = "#11111b";
                border = "#11111b";
                text = "#cba6f7";
              };

              inactiveWorkspace = {
                background = "#11111b";
                border = "#11111b";
                text = "#a6adc8";
              };

              separator = "#a6adc8";
              statusline = "#cdd6f4";
              urgentWorkspace = {
                background = "#f38ba8";
                border = "#f38ba8";
                text = "#11111b";
              };
            };

            fonts = {
              names = [ "Fira Mono" ];
              size = 8.0;
            };

            position = "bottom";
          }
        ];

        bindswitches =
          let
            display = "eDP-1";
          in
          {
            "lid:on" = {
              action = "output ${display} disable";
              locked = true;
              reload = true;
            };

            "lid:off" = {
              action = "output ${display} enable";
              locked = true;
              reload = true;
            };
          };

        colors = {
          focused = {
            background = "#1e1e2e";
            border = "#cba6f7";
            childBorder = "#cba6f7";
            indicator = "#f5c2e7";
            text = "#1e1e2e";
          };

          focusedInactive = {
            background = "#1e1e2e";
            border = "#585b70";
            childBorder = "#585b70";
            indicator = "#585b70";
            text = "#cdd6f4";
          };

          unfocused = {
            background = "#1e1e2e";
            border = "#313244";
            childBorder = "#313244";
            indicator = "#313244";
            text = "#a6adc8";
          };

          urgent = {
            background = "#1e1e2e";
            border = "#f38ba8";
            childBorder = "#f38ba8";
            indicator = "#f38ba8";
            text = "#1e1e2e";
          };
        };

        defaultWorkspace = "workspace number 1";
        floating = {
          criteria = [
            # TODO
          ];

          titlebar = false;
        };

        focus.followMouse = false;
        fonts = {
          names = [ "Fira Mono" ];
          size = 8.0;
        };

        gaps = {
          inner = 2;
          outer = 4;
        };

        input = {
          "type:touchpad" = {
            accel_profile = "flat";
            drag = "enabled";
            dwt = "enabled";
            natural_scroll = "enabled";
            tap = "enabled";
          };
        };
      };
    };
  };

  options.desktop.sessions.sway.enable = lib.mkEnableOption "the sway window manager";
}