niri: update rules to nix syntax
Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
parent
163cb674bb
commit
d8427e213a
2 changed files with 35 additions and 44 deletions
|
@ -61,48 +61,10 @@ in {
|
||||||
# https://github.com/YaLTeR/niri/wiki/Configuration:-Overview
|
# https://github.com/YaLTeR/niri/wiki/Configuration:-Overview
|
||||||
# HACK: Prepend validated kdl config not currently implemented in settings module for e.g. custom build
|
# HACK: Prepend validated kdl config not currently implemented in settings module for e.g. custom build
|
||||||
# https://github.com/sodiboo/niri-flake/blob/main/settings.nix
|
# https://github.com/sodiboo/niri-flake/blob/main/settings.nix
|
||||||
config = let
|
config = with inputs.niri-flake.lib;
|
||||||
# BUG: Fixed width may not take borders into account
|
(internal.settings-module {config = hm;}).options.programs.niri.config.default
|
||||||
# https://github.com/YaLTeR/niri/issues/269
|
# https://github.com/sodiboo/niri-flake/blob/main/default-config.kdl.nix
|
||||||
pip = with config.custom; rec {
|
++ (with kdl; []);
|
||||||
x = gap;
|
|
||||||
y = gap;
|
|
||||||
w = builtins.floor (width * 0.3 - gap); # 30%
|
|
||||||
h = builtins.floor (w * 9 / 16); # 16:9
|
|
||||||
};
|
|
||||||
in
|
|
||||||
with inputs.niri-flake.lib;
|
|
||||||
(internal.settings-module {config = hm;}).options.programs.niri.config.default
|
|
||||||
# https://github.com/sodiboo/niri-flake/blob/main/default-config.kdl.nix
|
|
||||||
++ (with kdl; [
|
|
||||||
# TODO: Migrate to window-rules when released
|
|
||||||
# https://github.com/YaLTeR/niri/pull/871
|
|
||||||
(plain "window-rule" [
|
|
||||||
(leaf "match" {is-floating = true;})
|
|
||||||
(plain "border" [(flag "off")])
|
|
||||||
(plain "focus-ring" [(flag "off")])
|
|
||||||
])
|
|
||||||
|
|
||||||
(plain "window-rule" [
|
|
||||||
(leaf "match" {title = "^Picture.in.[Pp]icture$";})
|
|
||||||
|
|
||||||
(leaf "default-floating-position" {
|
|
||||||
x = pip.x;
|
|
||||||
y = pip.y;
|
|
||||||
relative-to = "top-right";
|
|
||||||
})
|
|
||||||
|
|
||||||
(plain "default-column-width" [(leaf "fixed" (pip.w))])
|
|
||||||
(plain "default-window-height" [(leaf "fixed" (pip.h))])
|
|
||||||
(leaf "open-floating" true)
|
|
||||||
(leaf "open-focused" false)
|
|
||||||
])
|
|
||||||
|
|
||||||
(plain "window-rule" [
|
|
||||||
(leaf "match" {app-id = "^(sdl-|wl|x)freerdp$";})
|
|
||||||
(leaf "open-floating" false)
|
|
||||||
])
|
|
||||||
]);
|
|
||||||
|
|
||||||
# https://github.com/YaLTeR/niri/wiki/Configuration:-Debug-Options
|
# https://github.com/YaLTeR/niri/wiki/Configuration:-Debug-Options
|
||||||
# https://github.com/sodiboo/niri-flake/blob/main/docs.md#programsnirisettingsdebug
|
# https://github.com/sodiboo/niri-flake/blob/main/docs.md#programsnirisettingsdebug
|
||||||
|
|
|
@ -42,6 +42,14 @@ in {
|
||||||
clip-to-geometry = true;
|
clip-to-geometry = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
# Floating
|
||||||
|
matches = [{is-floating = true;}];
|
||||||
|
|
||||||
|
border.enable = false;
|
||||||
|
focus-ring.enable = false;
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
# Startup
|
# Startup
|
||||||
#?? <= 60 secs after niri launches
|
#?? <= 60 secs after niri launches
|
||||||
|
@ -139,10 +147,30 @@ in {
|
||||||
#// open-on-workspace = "2";
|
#// open-on-workspace = "2";
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
(let
|
||||||
|
# BUG: Fixed width may not take borders into account
|
||||||
|
# https://github.com/YaLTeR/niri/issues/269
|
||||||
|
pip = with config.custom; rec {
|
||||||
|
x = gap;
|
||||||
|
y = gap;
|
||||||
|
w = builtins.floor (width * 0.3 - gap); # 30%
|
||||||
|
h = builtins.floor (w * 9 / 16); # 16:9
|
||||||
|
};
|
||||||
|
in {
|
||||||
# PiP
|
# PiP
|
||||||
matches = [{title = "^Picture.in.[Pp]icture$";}];
|
matches = [{title = "^Picture.in.[Pp]icture$";}];
|
||||||
}
|
|
||||||
|
default-floating-position = {
|
||||||
|
x = pip.x;
|
||||||
|
y = pip.y;
|
||||||
|
relative-to = "top-right";
|
||||||
|
};
|
||||||
|
|
||||||
|
default-column-width.fixed = pip.w;
|
||||||
|
default-window-height.fixed = pip.h;
|
||||||
|
open-floating = true;
|
||||||
|
open-focused = false;
|
||||||
|
})
|
||||||
|
|
||||||
{
|
{
|
||||||
# Terminals
|
# Terminals
|
||||||
|
@ -170,6 +198,7 @@ in {
|
||||||
{app-id = "^virt-manager$";}
|
{app-id = "^virt-manager$";}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
open-floating = false;
|
||||||
#// open-on-workspace = "1";
|
#// open-on-workspace = "1";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue