I cannot figure out output position (niri) #390
Replies: 1 comment 3 replies
-
|
It is done like this (now) nix-wrapper-modules/wrapperModules/n/niri/check.nix Lines 75 to 88 in 01cb23e ^ If that throws an error, update nix-wrapper-modules, it has been very recently updated. This way with a function is more complete, and implements the whole kdl spec now. It used to be done like this nix-wrapper-modules/wrapperModules/n/niri/check.nix Lines 77 to 82 in 23b8770 And also you used to include However, So, now to represent that, you do If you were doing it correctly before, you will get a deprecation warning about this which tells you where they are and what to change (I hope, assuming my convertAndWarn function works correctly. It can be disabled with v2-settings once your config is compatible with the new version). The reason for the confusion is that in kdl, a node can look like f "arg1" "key"="val" {
g
}Or even weirder (string)"p" (string)"q" "r"=(string)"s" {
"t" #null
"t" 1
"t" 2
}This means that a simple set conversion is not enough, we need some kind of meta info. We solve this issue by providing a function which allows us to return a set with more options if required. There is now also a https://birdeehub.github.io/nix-wrapper-modules/lib/wlib.html#function-library-wlib.toKdl You can actually also outputs = {
"DP-3" = {
position = [
{
x = 1440;
y = 1080;
}
(_: { }) # <- stop it from treating this like a list of nodes and instead as props (empty functions become nothing)
];
background-color = "#003300";
hot-corners = {
off = _: { };
};
};
};The function should return a set, because that would be how you set the extra options, but if you want a function to become just a blank value, they can return whatever as long as it doesn't have those values in it. So you could even do outputs = {
"DP-3" = {
position = [
{
x = 1440;
y = 1080;
}
(_: 1) # <- still becomes nothing
];
background-color = "#003300";
hot-corners = {
off = _: 1; # <- also nothing, this node only has a name
};
};
};And those functions will still translate into nothing, other than maybe some weird but semantically insignificant spacing I also have moved the issue to discussions (and also added nix highlighting to your question), because it just changed, and I want to leave it up for a bit. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have had a heck of time trying to figure out how to set position for my displays. I have every combination of values that I could think of that makes sense but nothing returns the proper KDL format. I tried using Google Gemini, Claude, ChatGPT, Kagi Assistant and plain Web Searches all either giving me something I have already tried or something that just plain does not work
I have tried
and some other weird ones that AI gave that are just simply syntactically wrong. I am looking for my main
here is my entire niri config
Beta Was this translation helpful? Give feedback.
All reactions