blob: d9e3db649d9bfe685aa65f90ce5f0522d9c6db42 (
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
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
|
{
config,
lib,
options,
pkgs,
...
}:
{
options.desktop.windowManager = lib.mkOption { type = with lib.types; nullOr (enum [ "swayfx" ]); };
config = {
home.packages = with pkgs; [
grim
slurp
];
programs = {
swaylock = {
enable = true;
settings = {
color = "000000";
no-unlock-indicator = true;
};
};
waybar = {
enable = lib.mkDefault (config.desktop.windowManager == "swayfx");
settings = {
main = {
modules-left = [
"sway/workspaces"
"tray"
];
modules-center = [ "clock" ];
modules-right = [
"backlight"
"battery"
"network"
"wireplumber"
"cpu"
"memory"
];
backlight = {
format = "{icon}";
format-icons = [ "" "" ];
tooltip-format = "{percent}%";
};
battery = {
format = "{icon}";
format-critical = "{icon} ({capacity}%)";
format-icons = [ "" "" "" "" ];
format-time = "{H}h{m}m";
format-warning = "{icon} ({capacity}%)";
states = {
critical = 15;
warning = 25;
};
tooltip-format = "{time} remaining, {health}% battery health";
tooltip-format-critical = "plug yo shit in NOW!!";
};
cpu.format = "{avg_frequency} GHz";
clock = {
format = "{:%A, %b %d %Y - %H:%M %Z}";
# i am the time god. fear me.
timezones = [
"America/Toronto"
"America/Vancouver"
"America/Edmonton"
"America/Regina"
"America/Toronto" # duplicated so it appears in the list too
"America/Halifax"
"America/St_Johns"
"America/Sao_Paulo"
"Etc/UTC"
"Australia/Perth"
];
tooltip-format = "{tz_list}";
};
memory = {
format = "{used}/{total} GiB";
states = {
critical = 90;
warning = 70;
};
tooltip-format = "{percentage}% used";
};
network = {
format-disabled = "";
format-disconnected = "";
format-ethernet = " {ipaddr}/{cidr}";
format-icons = [ "" "" "" "" ];
format-wifi = "{icon}";
interval = 1;
tooltip-format = "{ifname} tx: {bandwidthUpBytes} rx: {bandwidthDownBytes}";
tooltip-format-wifi = ''
<b>Network:</b> {essid}
<b>{ifname}:</b> {ipaddr}/{cidr}
<b>tx:</b> {bandwidthUpBytes}
<b>rx:</b> {bandwidthDownBytes}
'';
};
position = "bottom";
"sway/workspaces" = {
all-outputs = true;
disable-scroll = true;
format = "";
persistent-workspaces = {
"1" = [ "DP-1" "eDP-1" ];
"2" = [ "DP-2" "eDP-1" ];
"3" = [];
"4" = [];
"5" = [];
"6" = [];
"7" = [];
"8" = [];
"9" = [];
};
};
wireplumber = {
format = "{icon}";
format-icons = [ "" "" "" ];
format-muted = "";
on-click = "wpctl set-mute @DEFAULT_SINK@ toggle";
tooltip-format = "{node_name} - {volume}%";
};
};
};
style = builtins.readFile ./waybar.css;
};
};
wayland.windowManager.sway =
if (config.desktop.windowManager == "swayfx") then
{
enable = lib.mkForce true;
package = null; # use the nixos module
config = {
bars = [ ];
bindswitches = {
"lid:off" = {
action = "output eDP-1 power on";
locked = true;
};
"lid:on" = {
action = "output eDP-1 power off";
locked = true;
};
};
colors = # rose pine theme
let
gold = "#f6c177";
hl3 = "#524f67";
love = "#eb6f92";
muted = "#6e6a86";
nothing = "#00000000";
overlay = "#26233a";
rose = "#ebbcba";
subtle = "#908caa";
text = "#e0def4";
in
{
focused = {
background = "${rose}";
border = "${rose}";
childBorder = "${rose}";
indicator = "${gold}";
text = "${hl3}";
};
focusedInactive = {
background = "${muted}";
border = "${nothing}";
childBorder = "${nothing}";
indicator = "${nothing}";
text = "${text}";
};
unfocused = {
background = "${overlay}";
border = "${nothing}";
childBorder = "${nothing}";
indicator = "${nothing}";
text = "${subtle}";
};
urgent = {
background = "${love}";
border = "${love}";
childBorder = "${love}";
indicator = "${love}";
text = "${text}";
};
};
floating.titlebar = false;
focus.followMouse = false;
fonts = {
names = [ "Fira Code" ];
size = 8.0;
};
gaps = {
inner = 4;
outer = 8;
};
input = {
"*" = {
accel_profile = "flat";
};
"type:touchpad" = {
drag = "enabled";
dwt = "enabled";
natural_scroll = "enabled";
tap = "enabled";
};
};
keybindings =
let
mod = config.wayland.windowManager.sway.config.modifier;
in
{
"${mod}+Return" = "exec foot";
"${mod}+Q" = "kill";
"${mod}+Alt+Q" = "exit";
"${mod}+V" = "splitt";
"${mod}+H" = "focus left";
"${mod}+J" = "focus down";
"${mod}+K" = "focus up";
"${mod}+L" = "focus right";
"${mod}+Shift+H" = "move left";
"${mod}+Shift+J" = "move down";
"${mod}+Shift+K" = "move up";
"${mod}+Shift+L" = "move right";
"${mod}+Minus" = "resize shrink width 5";
"${mod}+Shift+Equal" = "resize grow height 5";
"${mod}+Shift+Minus" = "resize shrink height 5";
"${mod}+Equal" = "resize grow width 5";
"${mod}+1" = "workspace 1";
"${mod}+2" = "workspace 2";
"${mod}+3" = "workspace 3";
"${mod}+4" = "workspace 4";
"${mod}+5" = "workspace 5";
"${mod}+6" = "workspace 6";
"${mod}+7" = "workspace 7";
"${mod}+8" = "workspace 8";
"${mod}+9" = "workspace 9";
"${mod}+Shift+1" = "move workspace 1";
"${mod}+Shift+2" = "move workspace 2";
"${mod}+Shift+3" = "move workspace 3";
"${mod}+Shift+4" = "move workspace 4";
"${mod}+Shift+5" = "move workspace 5";
"${mod}+Shift+6" = "move workspace 6";
"${mod}+Shift+7" = "move workspace 7";
"${mod}+Shift+8" = "move workspace 8";
"${mod}+Shift+9" = "move workspace 9";
"${mod}+F" = "floating toggle";
"${mod}+G" = "layout toggle split tabbed";
"${mod}+R" = "exec fuzzel";
"${mod}+Shift+S" = "exec grim -g \"$(slurp)\" ~/Pictures/screenshot.png";
"${mod}+Alt+L" = "exec swaylock";
"XF86AudioRaiseVolume" = "exec wpctl set-volume @DEFAULT_SINK@ 5%+ -l 1";
"XF86AudioLowerVolume" = "exec wpctl set-volume @DEFAULT_SINK@ 5%- -l 1";
"XF86AudioMute" = "exec wpctl set-mute @DEFAULT_SINK@ toggle";
"XF86MonBrightnessUp" = "exec brightnessctl --class=backlight s +10%";
"XF86MonBrightnessDown" = "exec brightnessctl --class=backlight s 10%-";
"Shift+XF86MonBrightnessUp" = "exec brightnessctl --device=chromeos::kbd_backlight s +10%";
"Shift+XF86MonBrightnessDown" = "exec brightnessctl --device=chromeos::kbd_backlight s 10%-";
"XF86RFKill" = "exec rfkill toggle 1";
};
modes = { };
modifier = "Mod4";
output = {
"eDP-1" = {
background = "~/Pictures/blossoms.jpg fill";
mode = "2256x1504@60Hz";
position = "0 0";
scale = "1.5";
};
"DP-1" = {
background = "~/Pictures/blossoms.jpg fill";
mode = "1920x1080@165Hz";
position = "0 0";
};
"DP-2" = {
background = "~/Pictures/blossoms.jpg fill";
mode = "1920x1080@75Hz";
position = "1920 0";
};
};
window.titlebar = false;
workspaceOutputAssign = [
{
output = [ "DP-1" "eDP-1" ];
workspace = "1";
}
{
output = "DP-2";
workspace = "2";
}
];
};
# inactive windows cast no shadow to avoid rendering shadows on top of
# the active window
extraConfig = ''
blur enable
blur_xray enable
corner_radius 10
shadows enable
shadow_inactive_color #00000000
exec waybar
'';
}
else
{ };
};
}
|