Skip to content

Commit 57f7011

Browse files
committed
niri small optimizations
1 parent e1773a8 commit 57f7011

File tree

1 file changed

+27
-15
lines changed

1 file changed

+27
-15
lines changed

home/wayland/niri.nix

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -307,17 +307,16 @@
307307
active.color = "#${config.colors.blue}";
308308
inactive.color = "#${config.colors.light_bg}";
309309
};
310-
default-column-width.proportion = 0.3333;
310+
default-column-width.proportion = 0.333;
311311
preset-column-widths = [
312-
{proportion = 0.3333;}
312+
{proportion = 0.333;}
313313
{proportion = 0.5;}
314-
{proportion = 0.6667;}
314+
{proportion = 0.667;}
315315
];
316316
preset-window-heights = [
317-
{proportion = 0.2;}
318-
{proportion = 0.4;}
319-
{proportion = 0.6;}
320-
{proportion = 0.8;}
317+
{proportion = 0.333;}
318+
{proportion = 0.5;}
319+
{proportion = 0.667;}
321320
];
322321
tab-indicator = {
323322
position = "right";
@@ -347,6 +346,15 @@
347346
];
348347
block-out-from = "screencast";
349348
}
349+
{
350+
matches = [
351+
{
352+
title = "Picture-in-Picture";
353+
app-id = "firefox";
354+
}
355+
];
356+
open-floating = true;
357+
}
350358
{
351359
matches = [
352360
{is-window-cast-target = true;}
@@ -425,8 +433,8 @@
425433

426434
# window width
427435
"Mod+R".action = switch-preset-column-width;
428-
"Mod+Comma".action = set-column-width "33.33%";
429-
"Mod+Period".action = set-column-width "66.67%";
436+
"Mod+Comma".action = set-column-width "33.3%";
437+
"Mod+Period".action = set-column-width "66.7%";
430438
"Mod+Slash".action = set-column-width "50%";
431439
"Mod+M".action = maximize-column;
432440
"Mod+Ctrl+M".action = expand-column-to-available-width;
@@ -452,22 +460,26 @@
452460
"Ctrl+Print".action = screenshot-window;
453461

454462
# focus
455-
"Mod+H".action = focus-column-left-or-last;
463+
# "Mod+H".action = focus-column-left-or-last;
464+
# "Mod+L".action = focus-column-right-or-first;
465+
"Mod+H".action = focus-column-or-monitor-left;
456466
"Mod+J".action = focus-window-or-workspace-down;
457467
"Mod+K".action = focus-window-or-workspace-up;
458-
"Mod+L".action = focus-column-right-or-first;
468+
"Mod+L".action = focus-column-or-monitor-right;
459469

460470
# small move
461471
"Mod+Shift+H".action = consume-or-expel-window-left;
462472
"Mod+Shift+L".action = consume-or-expel-window-right;
463-
"Mod+Shift+J".action = move-window-down-or-to-workspace-down;
464-
"Mod+Shift+K".action = move-window-up-or-to-workspace-up;
473+
"Mod+Shift+J".action = spawn "fish" "-c" "niri msg -j windows | jq -er '.[]|select(.is_focused==true)|.is_floating' && niri msg action move-window-to-workspace-down || niri msg action move-window-down-or-to-workspace-down";
474+
"Mod+Shift+K".action = spawn "fish" "-c" "niri msg -j windows | jq -er '.[]|select(.is_focused==true)|.is_floating' && niri msg action move-window-to-workspace-up || niri msg action move-window-up-or-to-workspace-up";
465475

466476
# large move
467-
"Mod+Ctrl+H".action = move-column-left;
477+
# "Mod+Ctrl+H".action = move-column-left-or-to-monitor-left;
468478
"Mod+Ctrl+J".action = move-workspace-down;
469479
"Mod+Ctrl+K".action = move-workspace-up;
470-
"Mod+Ctrl+L".action = move-column-right;
480+
# "Mod+Ctrl+L".action = move-column-right-or-to-monitor-right;
481+
"Mod+Ctrl+H".action = spawn "fish" "-c" "niri msg -j windows | jq -er '.[]|select(.is_focused==true)|.is_floating' && niri msg action move-window-to-monitor-left || niri msg action move-column-left-or-to-monitor-left";
482+
"Mod+Ctrl+L".action = spawn "fish" "-c" "niri msg -j windows | jq -er '.[]|select(.is_focused==true)|.is_floating' && niri msg action move-window-to-monitor-right || niri msg action move-column-right-or-to-monitor-right";
471483

472484
# swaylike workspace focus with wrapping
473485
# "Mod+Ctrl+J".action = spawn "fish" "-c" "niri msg -j workspaces | jq -r 'sort_by(.idx).[-2].is_focused' | grep true; and niri msg action focus-workspace (niri msg -j workspaces | jq -r 'sort_by(.idx).[0].idx'); or niri msg action focus-workspace-down";

0 commit comments

Comments
 (0)