blob: ca7a286ae7bf643ba571055c4a9a621effbd24fa (
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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
|
_inputs:
{
config,
lib,
pkgs,
...
}:
{
services.greetd = {
enable = true;
vt = 6;
settings.default_session.command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd sway";
};
home-manager.users.minijackson =
{ config, osConfig, ... }:
{
wayland.windowManager.sway = {
enable = true;
extraSessionCommands =
let
schema = pkgs.gsettings-desktop-schemas;
datadir = "${schema}/share/gsettings-schemas/${schema.name}";
in
''
# https://github.com/emersion/xdg-desktop-portal-wlr/issues/20
export XDG_CURRENT_DESKTOP=sway
# https://github.com/emersion/xdg-desktop-portal-wlr/pull/11
export XDG_SESSION_TYPE=wayland
# Makes gsettings work
export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS
export SDL_VIDEODRIVER=wayland
export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
'';
wrapperFeatures.gtk = true;
config = {
workspaceLayout = "tabbed";
# Using waybar
bars = [ ];
colors = with osConfig.theme.colors; {
focused = {
border = lightBackground;
background = lightBackground;
text = foreground;
indicator = dominant;
childBorder = dominant;
};
focusedInactive = {
border = background;
background = background;
text = dimForeground;
indicator = dominant;
childBorder = background;
};
unfocused = {
border = background;
background = background;
text = dimForeground;
indicator = dominant;
childBorder = background;
};
urgent = {
border = brightRed;
background = brightRed;
text = foreground;
indicator = brightRed;
childBorder = brightRed;
};
placeholder = {
border = background0;
background = background0;
text = foreground;
indicator = background0;
childBorder = background0;
};
};
floating.criteria = [ { title = "Steam - News"; } ];
input = {
"*" = {
xkb_options = "compose:caps";
};
"1:1:AT_Translated_Set_2_keyboard" = {
xkb_layout = "fr";
xkb_variant = "oss";
xkb_options = "compose:caps";
xkb_numlock = "enabled";
};
"1452:514:Alps_Electric_M2452" = {
xkb_layout = "fr";
xkb_variant = "oss";
xkb_options = "compose:caps,lv3:rwin_switch";
xkb_numlock = "enabled";
};
"7764:8240:TypeMatrix.com_USB_Keyboard" = {
xkb_layout = "us";
xkb_variant = "dvorak";
xkb_options = "eurosign:e,compose:caps";
xkb_numlock = "enabled";
};
"1133:49948:Logitech_USB_Keyboard" = {
xkb_layout = "fr";
xkb_variant = "oss";
xkb_options = "eurosign:e,compose:caps";
xkb_numlock = "enabled";
};
"1102:4639:DELL0817:00_044E:121F_Mouse" = {
scroll_method = "on_button_down";
scroll_button = "button2";
};
};
keybindings =
let
modifier = config.wayland.windowManager.sway.config.modifier;
inherit (lib) getExe;
inherit (pkgs)
brightnessctl
grim
pamixer
slurp
;
in
lib.mkOptionDefault {
"${modifier}+ampersand" = "workspace 1";
"${modifier}+eacute" = "workspace 2";
"${modifier}+quotedbl" = "workspace 3";
"${modifier}+apostrophe" = "workspace 4";
"${modifier}+parenleft" = "workspace 5";
"${modifier}+minus" = "workspace 6";
"${modifier}+egrave" = "workspace 7";
"${modifier}+underscore" = "workspace 8";
"${modifier}+ccedilla" = "workspace 9";
"${modifier}+agrave" = "workspace 10";
"${modifier}+Shift+ampersand" = "move container to workspace 1";
"${modifier}+Shift+eacute" = "move container to workspace 2";
"${modifier}+Shift+quotedbl" = "move container to workspace 3";
"${modifier}+Shift+apostrophe" = "move container to workspace 4";
"${modifier}+Shift+parenleft" = "move container to workspace 5";
"${modifier}+Shift+minus" = "move container to workspace 6";
"${modifier}+Shift+egrave" = "move container to workspace 7";
"${modifier}+Shift+underscore" = "move container to workspace 8";
"${modifier}+Shift+ccedilla" = "move container to workspace 9";
"${modifier}+Shift+agrave" = "move container to workspace 10";
"${modifier}+Ctrl+h" = "move workspace to output left";
"${modifier}+Ctrl+j" = "move workspace to output down";
"${modifier}+Ctrl+k" = "move workspace to output up";
"${modifier}+Ctrl+l" = "move workspace to output right";
"${modifier}+Ctrl+Left" = "move workspace to output left";
"${modifier}+Ctrl+Down" = "move workspace to output down";
"${modifier}+Ctrl+Up" = "move workspace to output up";
"${modifier}+Ctrl+Right" = "move workspace to output right";
"${modifier}+n" = "split none";
"${modifier}+comma" = "exec swaync-client --close-latest";
"${modifier}+Shift+comma" = "exec swaync-client --close-all";
"${modifier}+period" = "exec swaync-client --toggle-panel";
"${modifier}+m" = "exec ${pkgs.swaylock}/bin/swaylock";
"${modifier}+c" = "exec rofi -show calc -modi calc -no-sort -no-persist-history -calc-command 'echo -n {result} | wl-copy'";
"${modifier}+p" = "exec rofi-pass";
"XF86AudioRaiseVolume" = "exec ${getExe pamixer} -i 5";
"XF86AudioLowerVolume" = "exec ${getExe pamixer} -d 5";
"XF86AudioMute" = "exec ${getExe pamixer} -t";
"XF86MonBrightnessUp" = "exec ${getExe brightnessctl} set -- +10%";
"XF86MonBrightnessDown" = "exec ${getExe brightnessctl} set -- -10%";
"Print" = "exec ${getExe grim}";
"Shift+Print" = "exec ${getExe slurp} | ${getExe grim} -g -";
};
menu = ''
rofi -show drun -terminal alacritty -modi "drun,run,emoji,keys"
'';
modifier = "Mod4";
output."*".bg = "${../../../res/wallpapers/wallpaper-1920x1080-kernel-card-black.png} fill";
startup = [ { command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; } ];
terminal = "${pkgs.alacritty}/bin/alacritty";
window = {
border = 2;
hideEdgeBorders = "smart";
};
};
};
services.swaync = {
enable = true;
settings = {
widgets = [
"buttons-grid"
"mpris"
"volume"
"backlight"
"inhibitors"
"title"
"dnd"
"notifications"
];
widget-config = {
buttons-grid.actions = [
{
label = "";
command = "systemctl reboot";
}
{
label = "";
command = "systemctl poweroff";
}
];
volume = {
label = "";
show-per-app = true;
show-per-app-label = true;
};
};
};
style = pkgs.substituteAll {
src = ./swaync.css;
inherit (osConfig.theme.colors)
background1
background2
background5
dimDominant
dominant
foreground
foreground3
softBackground
;
};
};
services.wlsunset = {
enable = true;
latitude = "48.864716";
longitude = "2.349014";
# Reduce blue light anyways
temperature = {
day = 4000;
night = 2500;
};
};
programs.swaylock = {
enable = true;
settings =
let
inherit (osConfig.theme.colors)
background
brightGreen
brightOrange
brightRed
dominant
neutralOrange
neutralRed
;
in
{
ignore-empty-password = true;
show-failed-attempts = true;
image = "${../../../res/wallpapers/wallpaper-1920x1080-install-gentoo.png}";
font = "monospace";
inside-color = "${lib.removePrefix "#" dominant}dd";
inside-clear-color = "${lib.removePrefix "#" neutralOrange}dd";
inside-ver-color = "${lib.removePrefix "#" neutralOrange}dd";
inside-wrong-color = "${lib.removePrefix "#" neutralRed}dd";
key-hl-color = "${lib.removePrefix "#" brightGreen}ee";
bs-hl-color = "${lib.removePrefix "#" neutralRed}ee";
line-color = "${lib.removePrefix "#" background}ee";
line-clear-color = "${lib.removePrefix "#" background}ee";
line-ver-color = "${lib.removePrefix "#" background}ee";
line-wrong-color = "${lib.removePrefix "#" background}ee";
ring-color = "${lib.removePrefix "#" dominant}ee";
ring-clear-color = "${lib.removePrefix "#" brightOrange}ee";
ring-ver-color = "${lib.removePrefix "#" brightOrange}ee";
ring-wrong-color = "${lib.removePrefix "#" brightRed}ee";
separator-color = "${lib.removePrefix "#" background}ee";
text-color = "${lib.removePrefix "#" background}ff";
text-clear-color = "${lib.removePrefix "#" background}ff";
text-ver-color = "${lib.removePrefix "#" background}ff";
text-wrong-color = "${lib.removePrefix "#" background}ff";
indicator-radius = 75;
indicator-thickness = 10;
};
};
xsession.importedVariables = [
"DBUS_SESSION_BUS_ADDRESS"
"DISPLAY"
"SSH_AUTH_SOCK"
"XAUTHORITY"
"XDG_DATA_DIRS"
"XDG_RUNTIME_DIR"
"XDG_SESSION_ID"
"WAYLAND_DISPLAY"
"SWAYSOCK"
"I3SOCK"
"XDG_CURRENT_DESKTOP"
"XDG_SESSION_TYPE"
];
};
# TODO: polkit gnome
environment.systemPackages = with pkgs; [
grim
qt5.qtwayland
slurp
wl-clipboard
];
programs.xwayland.enable = true;
security.pam.services.swaylock = { };
xdg.portal = {
wlr = {
enable = true;
settings.screencast =
let
swaync-client = "${lib.getBin config.home-manager.users.minijackson.services.swaync.package}/bin/swaync-client";
in
{
exec_before = "${swaync-client} --inhibitor-add xdg-desktop-portal-wlr";
exec_after = "${swaync-client} --inhibitor-remove xdg-desktop-portal-wlr";
};
};
config.sway.default = [
"wlr"
"gtk"
];
};
}
|