blob: a7938c023d086151e66f952cb50afdb15ca1b75b (
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
|
{
self,
config,
lib,
pkgs,
nixgl,
...
}:
let
cfg = config.modules.sway;
scheme = config.modules.scheme;
in
{
options.modules.sway = {
enable = lib.mkEnableOption "sway";
wrapWithNixGL = lib.mkEnableOption "NixGL wrapper.";
terminal = lib.mkOption {
type = lib.types.str;
description = "Terminal command.";
};
startup = lib.mkOption {
type = lib.types.listOf (
lib.types.submodule {
options = {
command = lib.mkOption {
type = lib.types.string;
description = "Command to be executed on startup.";
};
always = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Whether to run command on each restart";
};
};
}
);
default = [ ];
description = "List of commands that sway will run on startup. This should be used only for sway specific applications";
};
};
config = {
home.packages = with pkgs; [
(writeShellScriptBin "browser" ''
swaymsg 'set $PROP newcont:tabbed ; exec qutebrowser --target window'
'')
autotiling
pamixer
killall
];
wayland.windowManager.sway = lib.mkIf cfg.enable {
checkConfig = false;
enable = true;
systemd.enable = true;
package = if cfg.wrapWithNixGL then (config.lib.nixGL.wrap pkgs.sway) else pkgs.sway;
# package = null;
config = rec {
modifier = "Mod4";
left = "m";
down = "n";
up = "e";
right = "i";
fonts = {
names = [
"sans-serif"
"monospace"
];
# style = "Bold";
size = 10.0;
};
terminal = "${cfg.terminal}";
# menu = ''wmenu-run -n 4c4c4c -N 0d0d0d -s 8aac8b -S 0d0d0d -l 10 -f "ComicShannsMono Nerd Font Mono 10"'';
# menu = "tofi-run | xargs swaymsg exec";
menu = "fuzzel";
defaultWorkspace = "workspace number 1";
input = {
"type:keyboard" = {
xkb_layout = "us,us";
xkb_variant = "colemak_dh,";
};
"type:touchpad" = {
dwt = "enabled"; # turn off if u are a gamer
tap = "enabled";
middle_emulation = "enabled";
};
"type:pointer" = {
accel_profile = "flat";
};
};
output = {
"*" = {
bg = "${scheme.base00} solid_color";
};
"eDP-1" = {
mode = "2880x1920@120.00Hz";
scale = "2.0";
};
"DP-2" = {
mode = "1920x1080@239.761Hz";
position = "0,440";
};
"HDMI-A-1" = {
transform = "90";
position = "1920,0";
};
};
# gaps = {
# inner = 10;
# outer = 0;
# };
workspaceAutoBackAndForth = false;
workspaceOutputAssign = [
{
output = "HDMI-A-1";
workspace = "0";
}
];
colors = {
background = scheme.base00;
focused = {
border = scheme.base0D; # the border around the titlebar
background = scheme.base0D;
childBorder = scheme.base0D;
text = scheme.base00; # TODO: light/dark
indicator = scheme.base09;
};
focusedInactive = {
border = scheme.base00;
background = scheme.base00;
text = scheme.base0D;
indicator = scheme.base02;
childBorder = scheme.base00;
};
unfocused = {
border = scheme.base00;
background = scheme.base00;
text = scheme.base04;
indicator = scheme.base01;
childBorder = scheme.base00;
};
};
bars = [
# {
# command = "waybar";
# }
{
statusCommand = "py3status";
# mode = "hide";
# hiddenState = "hide";
position = "top";
fonts = {
names = [
# "sans-serif"
"monospace"
];
size = "10.0";
};
extraConfig = ''
modifier ${modifier}
separator_symbol " "
'';
colors = {
background = scheme.base10; # "#0d0d0d";
statusline = scheme.base05;
focusedWorkspace = {
border = scheme.base10; # "#0d0d0d";
background = scheme.base10; # "#0d0d0d";
text = scheme.base05;
};
activeWorkspace = {
border = scheme.base10; # "#0d0d0d";
background = scheme.base10; # "#0d0d0d";
text = scheme.base01;
};
inactiveWorkspace = {
border = scheme.base10; # "#0d0d0d";
background = scheme.base10; # "#0d0d0d";
text = scheme.base01;
};
bindingMode = {
border = scheme.base00; # "#0d0d0d";
background = scheme.base10; # "#0d0d0d";
text = scheme.base0E;
};
};
}
];
focus = {
followMouse = false;
wrapping = "force";
};
window = {
border = 2;
# hideEdgeBorders = "--i3 smart";
commands = [
{
command = "mark --add \"prop:$$PROP:\"";
criteria = {
shell = ".";
};
}
{
command = "splith";
criteria = {
con_mark = "^prop.*:newcont:";
};
}
{
command = "layout tabbed";
criteria = {
con_mark = "^prop.*:tabbed:";
};
}
{
command = "mark --toggle \"prop:$$PROP:\" ; set $$PROP none";
criteria = {
con_mark = "^prop:";
};
}
];
};
keybindings = {
"${modifier}+Return" = "exec ${terminal}";
"${modifier}+p" = "exec passmenu";
"${modifier}+Shift+w" = "exec browser";
"${modifier}+d" = "exec ${menu}";
"${modifier}+Shift+c" = "kill";
"${modifier}+Shift+r" = "reload";
"${modifier}+Shift+q" =
"exec swaynag -t warning -m 'do you really want to exit?' -B 'yes, exit' 'swaymsg exit'";
"${modifier}+${left}" = "focus left";
"${modifier}+${down}" = "focus down";
"${modifier}+${up}" = "focus up";
"${modifier}+${right}" = "focus right";
"${modifier}+a" = "focus parent";
"${modifier}+s" = "focus child";
"${modifier}+Shift+${left}" = "move left";
"${modifier}+Shift+${down}" = "move down";
"${modifier}+Shift+${up}" = "move up";
"${modifier}+Shift+${right}" = "move right";
"${modifier}+r" = "mode resize";
"${modifier}+1" = "workspace number 1";
"${modifier}+2" = "workspace number 2";
"${modifier}+3" = "workspace number 3";
"${modifier}+4" = "workspace number 4";
"${modifier}+5" = "workspace number 5";
"${modifier}+6" = "workspace number 6";
"${modifier}+7" = "workspace number 7";
"${modifier}+8" = "workspace number 8";
"${modifier}+9" = "workspace number 9";
"${modifier}+period" = "workspace number 0";
"${modifier}+Shift+1" = "move container to workspace number 1";
"${modifier}+Shift+2" = "move container to workspace number 2";
"${modifier}+Shift+3" = "move container to workspace number 3";
"${modifier}+Shift+4" = "move container to workspace number 4";
"${modifier}+Shift+5" = "move container to workspace number 5";
"${modifier}+Shift+6" = "move container to workspace number 6";
"${modifier}+Shift+7" = "move container to workspace number 7";
"${modifier}+Shift+8" = "move container to workspace number 8";
"${modifier}+Shift+9" = "move container to workspace number 9";
"${modifier}+Shift+0" = "move container to workspace number 0";
"${modifier}+Shift+minus" = "move scratchpad";
"${modifier}+minus" = "scratchpad show";
"${modifier}+h" = "splith";
"${modifier}+v" = "splitv";
"${modifier}+Shift+s" = "layout stacking";
"${modifier}+w" = "layout tabbed";
"${modifier}+t" = "layout toggle split";
"${modifier}+Shift+space" = "floating toggle";
"${modifier}+space" = "focus mode_toggle";
"${modifier}+Shift+f" = "fullscreen";
# this can probably be simplified but im not a sed wizard
"--locked XF86AudioRaiseVolume" = "exec pamixer -ui 2 && pamixer --get-volume > $WOBSOCK && killall -s USR1 -r py3status";
"--locked XF86AudioLowerVolume" = "exec pamixer -ud 2 && pamixer --get-volume > $WOBSOCK && killall -s USR1 -r py3status";
"--locked XF86AudioMute" =
''exec pamixer --toggle-mute && ( [ "$(pamixer --get-mute)" = "true" ] && echo 0 > $WOBSOCK ) || pamixer --get-volume > $WOBSOCK && killall -s USR1 -r py3status'';
"--locked XF86MonBrightnessUp" = "exec light -A 5 && light -G | cut -d'.' -f1 > $WOBSOCK";
"--locked XF86MonBrightnessDown" = "exec light -U 5 && light -G | cut -d'.' -f1 > $WOBSOCK";
};
startup = cfg.startup;
seat = {
"*" = {
# hide_cursor = "1500";
xcursor_theme = "Adwaita 18";
};
};
};
extraConfigEarly = ''
set $PROP none
set $WOBSOCK $XDG_RUNTIME_DIR/wob.sock
'';
extraConfig = ''
title_align center
default_border pixel 1
mouse_warping none
output HDMI-A-1 disable
'';
# + ''
# blur enable
# blur_xray disable
# corner_radius 0
# shadows disable
# titlebar_separator disable
#
# layer_effects "launcher" {
# reset;
# blur enable;
# shadows disable;
# }
# '';
};
};
}
|