summaryrefslogtreecommitdiff
path: root/.config/niri/config.kdl
blob: fad4ff97c2322d21ffa8b6b40281d9d84be1d8e5 (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
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
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
spawn-at-startup "qs" "-c" "noctalia-shell"
spawn-at-startup "gentoo-pipewire-launcher"

// https://yalter.github.io/niri/Configuration:-Input
input {
	keyboard {
		xkb {
			layout "mango,mango,mango"
			variant "english,german,swedish"
			options "lv3:switch,compose:ralt"
		}

		repeat-delay 360
		repeat-rate 35
		numlock
	}

	touchpad {
		tap
		dwt
		drag true
		natural-scroll
		accel-speed 0.2
		accel-profile "adaptive"
		scroll-method "two-finger"
	}

	mouse {
		natural-scroll
		accel-speed 0.2
		accel-profile "adaptive"
	}

	focus-follows-mouse
	workspace-auto-back-and-forth
}


output "DP-1" {
    mode "5120x1440@144.000"
    scale 1
    position x=0 y=0
	focus-at-startup
}

output "DP-2" {
    mode "5120x1440@144.000"
    scale 1
    position x=0 y=0
	focus-at-startup
}

output "eDP-1" {
    mode "2256x1504@60.000"
    scale 1
    position x=1432 y=1440
}

cursor {
	xcursor-theme "Adwaita"
	xcursor-size 24
}

layout {
	gaps 12
	background-color "#000"

	always-center-single-column
	center-focused-column "on-overflow"

	preset-column-widths {
		proportion 0.33333
		proportion 0.50000
		proportion 0.66667
	}

	default-column-width {
		proportion 0.33333
	}

	focus-ring {
		off
	}

	border {
		width 2
		active-gradient from="#FAA14F" to="#B8F182" angle=150 relative-to="workspace-view"
		inactive-color "#363C4A"
		urgent-color "#841A11"
	}

	shadow {
		on
		draw-behind-window true

		softness 10
		spread 12
		offset x=12 y=12
		color "#0005"
	}

	default-column-display "tabbed"
	tab-indicator {
		hide-when-single-tab
		width 4
		length total-proportion=0.9
		corner-radius 16
		active-gradient from="#FAA14F" to="#B8F182" angle=150
		inactive-color "#363C4A"
		urgent-color "#841A11"
	}
}

hotkey-overlay {
	skip-at-startup
}

prefer-no-csd

screenshot-path "~/media/img/screen/%Y-%m-%d_%H-%M-%S.png"

// Animation settings.
// The wiki explains how to configure individual animations:
// https://yalter.github.io/niri/Configuration:-Animations
animations {
	window-open {
		duration-ms 250
		curve "linear"
		custom-shader r#"
			vec4
			open_color(vec3 coords_geo, vec3 size_geo)
			{
			  if (coords_geo.x < 0.0 || coords_geo.x > 1.0
				  || coords_geo.y < 0.0 || coords_geo.y > 1.0)
				{
				  return vec4(0.0);
				}

			  float p = niri_clamped_progress;
			  float ease_out = 1.0 - pow(1.0 - p, 3.0);
			  float scale = mix(0.92, 1.0, ease_out);

			  vec2 uv = coords_geo.xy;
			  uv -= vec2(0.5);
			  uv /= scale;
			  uv += vec2(0.5);

			  if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0)
				return vec4(0.0);

			  vec3 coords_tex = niri_geo_to_tex * vec3(uv, 1.0);
			  vec4 color = texture2D(niri_tex, coords_tex.st);

			  float flash_amount = pow(1.0 - p, 4.0);

			  color.rgb *= (1.0 + flash_amount * 5.0);

			  vec3 pure_white = vec3(0.5) * color.a;
			  color.rgb += pure_white * (flash_amount * 1.5);

			  color.rgb = clamp(color.rgb, 0.0, color.a);

			  float fade_in = smoothstep(0.0, 0.05, p);
			  color *= fade_in;

			  return color;
			}
		"#
	}

	window-close {
		duration-ms 500
		curve "ease-out-quad"
		custom-shader r#"
			vec4
			close_color(vec3 coords_geo, vec3 size_geo)
			{
			  float p = niri_clamped_progress;

			  float t_vert = clamp(p / 0.5, 0.0, 1.0);
			  float t_horz = clamp((p - 0.5) / 0.3, 0.0, 1.0);
			  float t_fade = clamp((p - 0.8) / 0.2, 0.0, 1.0);

			  float scale_y = max(1.0 - (t_vert * t_vert * t_vert), 0.002);
			  float scale_x = max(1.0 - (t_horz * t_horz), 0.002);

			  vec2 uv = coords_geo.xy;
			  uv -= vec2(0.5);
			  uv.y /= scale_y;
			  uv.x /= scale_x;
			  uv += vec2(0.5);

			  vec4 color = vec4(0.0);

			  if (uv.x >= 0.0 && uv.x <= 1.0 && uv.y >= 0.0 && uv.y <= 1.0) {
				vec3 mapped_geo = vec3(uv, 1.0);
				vec3 coords_tex = niri_geo_to_tex * mapped_geo;
				color = texture2D(niri_tex, coords_tex.st);

				float exposure = 1.0 + (25.0 * t_vert);
				color.rgb *= exposure;

				color.rgb = clamp(color.rgb, 0.0, color.a);
			  }

			  color *= (1.0 - t_horz);

			  float aspect = size_geo.x / size_geo.y;
			  vec2 center_dist = coords_geo.xy - vec2(0.5);
			  center_dist.x *= aspect;
			  float dist = length(center_dist);

			  float dot_size = mix(0.012, 0.000, t_fade);

			  float core = smoothstep(dot_size, 0.0, dist);
			  float glow = smoothstep(dot_size * 6.0, 0.0, dist) * 0.8;

			  float dot_intensity = clamp(core + glow, 0.0, 1.0);

			  vec3 current_dot_color = vec3(1.0);

			  vec4 dot_color = vec4(current_dot_color * dot_intensity, dot_intensity);

			  float dot_visibility = smoothstep(0.0, 0.5, t_horz);
			  dot_color *= dot_visibility;

			  return clamp(color + dot_color, 0.0, 1.0);
			}
		"#
	}

	window-resize {
		duration-ms 200
		curve "ease-out-quad"
		custom-shader r#"
			vec4
			resize_color(vec3 coords_curr_geo, vec3 size_curr_geo)
			{
			  if (coords_curr_geo.x < 0.0 || coords_curr_geo.x > 1.0
				  || coords_curr_geo.y < 0.0 || coords_curr_geo.y > 1.0)
				{
				  return vec4(0.0);
				}

			  float p = niri_clamped_progress;
			  float ease_out = 1.0 - (1.0 - p) * (1.0 - p);
			  float ghost_activity = sin(p * 3.14159);

			  vec2 uv = coords_curr_geo.xy;
			  vec3 coords_next_tex = niri_geo_to_tex_next * vec3(uv, 1.0);
			  vec4 color_next = texture2D(niri_tex_next, coords_next_tex.st);

			  float next_flash = ghost_activity * 0.1;
			  color_next.rgb += vec3(1.0) * next_flash * color_next.a;

			  vec3 coords_prev_tex = niri_geo_to_tex_prev * vec3(uv, 1.0);
			  vec4 color_prev = texture2D(niri_tex_prev, coords_prev_tex.st);

			  float luminance = dot(color_prev.rgb, vec3(0.299, 0.587, 0.114));
			  vec3 phosphor_color = vec3(0.5);
			  vec4 ghost = vec4(phosphor_color * (luminance * 2.5), color_prev.a);

			  ghost.rgb += vec3(1.0) * (pow(luminance, 4.0) * 1.5);
			  float ghost_intensity = ghost_activity * 0.7;
			  ghost *= ghost_intensity;

			  vec4 base_color = mix(color_prev, color_next, ease_out);
			  vec4 color = clamp(base_color + ghost, 0.0, 1.0);
			  color.rgb = clamp(color.rgb, 0.0, color.a);
			  return color;
			}
		"#
	}
}

// Window rules let you adjust behavior for individual windows.
// Find more information on the wiki:
// https://yalter.github.io/niri/Configuration:-Window-Rules

window-rule {
	match app-id="-floating$"
	open-floating true
	default-column-width { fixed 1200; }
	default-window-height { fixed 800; }
}

window-rule {
	match app-id="^qalculate-(gtk|qt)-floating$"
	default-column-width { fixed 800; }
	default-window-height { fixed 600; }
}

// Example: block out two password managers from screen capture.
// (This example rule is commented out with a "/-" in front.)
/-window-rule {
	match app-id=r#"^org\.keepassxc\.KeePassXC$"#
	match app-id=r#"^org\.gnome\.World\.Secrets$"#

	block-out-from "screen-capture"

	// Use this instead if you want them visible on third-party screenshot tools.
	// block-out-from "screencast"
}

layer-rule {
	match namespace="^noctalia-overview*"
	place-within-backdrop true
}

binds {
	Mod+Shift+Slash { show-hotkey-overlay; }
	XF86Tools {
		spawn "emacs" "/home/thomas/.config"
	}

	Mod+Return hotkey-overlay-title="Terminal" {
		spawn "foot"
	}
	Mod+Ctrl+Return hotkey-overlay-title="Terminal (Scratch)" {
		spawn "foot" "-a" "foot-floating"
	}
	Mod+Space hotkey-overlay-title="App Launcher" {
		spawn "fuzzel" "-I" "--log-level=warning" "--show-actions"
	}
	Mod+Ctrl+Space hotkey-overlay-title="App Launcher (Scratch)" {
		spawn "fuzzel" "-I" "--log-level=warning" "--launch-prefix=fuzzel-floating"
	}

	/- Super+Alt+L hotkey-overlay-title="Screenlock" {
		spawn "swaylock"
	}

	/* Ljudkontroll */
	XF86AudioRaiseVolume allow-when-locked=true {
		spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+" "-l" "1.0"
	}
	XF86AudioLowerVolume allow-when-locked=true {
		spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"
	}
	XF86AudioMute allow-when-locked=true {
		spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"
	}
	XF86AudioMicMute allow-when-locked=true {
		spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"
	}

	/* Mediakontroll */
	XF86AudioPlay allow-when-locked=true {
		spawn "playerctl" "play-pause"
	}
	XF86AudioStop allow-when-locked=true {
		spawn "playerctl" "stop"
	}
	XF86AudioPrev allow-when-locked=true {
		spawn "playerctl" "previous"
	}
	XF86AudioNext allow-when-locked=true {
		spawn "playerctl" "next"
	}

	XF86MonBrightnessUp allow-when-locked=true {
		spawn "brightnessctl" "--class=backlight" "set" "+10%"
	}
	XF86MonBrightnessDown allow-when-locked=true {
		spawn "brightnessctl" "--class=backlight" "set" "10%-"
	}

	Mod+Q repeat=false { close-window; }

	Mod+Left  { focus-column-left; }
	Mod+Down  { focus-window-down; }
	Mod+Up	  { focus-window-up; }
	Mod+Right { focus-column-right; }
	Mod+F	  { focus-column-right; }
	Mod+B	  { focus-column-left; }
	Mod+N	  { focus-window-down-or-top; }
	Mod+P	  { focus-window-up-or-bottom; }

	Mod+Ctrl+Left  { move-column-left; }
	Mod+Ctrl+Down  { move-window-down; }
	Mod+Ctrl+Up	   { move-window-up; }
	Mod+Ctrl+Right { move-column-right; }
	Mod+Ctrl+F	   { move-column-right; }
	Mod+Ctrl+B	   { move-column-left; }
	Mod+Ctrl+N	   { move-window-down; }
	Mod+Ctrl+P	   { move-window-up; }

	Mod+Home	  { focus-column-first; }
	Mod+End		  { focus-column-last; }
	Mod+Ctrl+Home { move-column-to-first; }
	Mod+Ctrl+End  { move-column-to-last; }
	Mod+A		  { focus-column-first; }
	Mod+E		  { focus-column-last; }
	Mod+Ctrl+A	  { move-column-to-first; }
	Mod+Ctrl+E	  { move-column-to-last; }

	Mod+Shift+Left	{ focus-monitor-left; }
	Mod+Shift+Down	{ focus-monitor-down; }
	Mod+Shift+Up	{ focus-monitor-up; }
	Mod+Shift+Right { focus-monitor-right; }

	Mod+1 { focus-workspace 1; }
	Mod+2 { focus-workspace 2; }
	Mod+3 { focus-workspace 3; }
	Mod+4 { focus-workspace 4; }
	Mod+5 { focus-workspace 5; }
	Mod+6 { focus-workspace 6; }
	Mod+7 { focus-workspace 7; }
	Mod+8 { focus-workspace 8; }
	Mod+9 { focus-workspace 9; }
	Mod+Shift+1 { focus-workspace 1; }
	Mod+Shift+2 { focus-workspace 2; }
	Mod+Shift+3 { focus-workspace 3; }
	Mod+Shift+4 { focus-workspace 4; }
	Mod+Shift+5 { focus-workspace 5; }
	Mod+Shift+6 { focus-workspace 6; }
	Mod+Shift+7 { focus-workspace 7; }
	Mod+Shift+8 { focus-workspace 8; }
	Mod+Shift+9 { focus-workspace 9; }

	Mod+Ctrl+1 { move-column-to-workspace 1; }
	Mod+Ctrl+2 { move-column-to-workspace 2; }
	Mod+Ctrl+3 { move-column-to-workspace 3; }
	Mod+Ctrl+4 { move-column-to-workspace 4; }
	Mod+Ctrl+5 { move-column-to-workspace 5; }
	Mod+Ctrl+6 { move-column-to-workspace 6; }
	Mod+Ctrl+7 { move-column-to-workspace 7; }
	Mod+Ctrl+8 { move-column-to-workspace 8; }
	Mod+Ctrl+9 { move-column-to-workspace 9; }
	Mod+Ctrl+Shift+1 { move-column-to-workspace 1; }
	Mod+Ctrl+Shift+2 { move-column-to-workspace 2; }
	Mod+Ctrl+Shift+3 { move-column-to-workspace 3; }
	Mod+Ctrl+Shift+4 { move-column-to-workspace 4; }
	Mod+Ctrl+Shift+5 { move-column-to-workspace 5; }
	Mod+Ctrl+Shift+6 { move-column-to-workspace 6; }
	Mod+Ctrl+Shift+7 { move-column-to-workspace 7; }
	Mod+Ctrl+Shift+8 { move-column-to-workspace 8; }
	Mod+Ctrl+Shift+9 { move-column-to-workspace 9; }

	Mod+Comma  { consume-window-into-column; }
	Mod+Period { expel-window-from-column; }

	Mod+Ctrl+M { maximize-column; }
	Mod+Ctrl+Shift+M { fullscreen-window; }
	Mod+L { center-window; }
	Mod+R { switch-preset-column-width; }
	Mod+W { toggle-column-tabbed-display; }
	Mod+O { toggle-overview; }
	Mod+T { toggle-window-floating; }

	Print { screenshot; }
	Ctrl+Print { screenshot-screen; }
	Alt+Print { screenshot-window; }

	Mod+Shift+Comma { focus-workspace-up; }
	Mod+Shift+Period { focus-workspace-down; }

	Mod+Ctrl+G allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
}