gui(niri): Use cage to launch regreet instead of niri-session

This commit is contained in:
ulic-youthlic 2025-05-11 12:26:25 +08:00
parent 090e7d3578
commit 76f5354dca
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
3 changed files with 4 additions and 61 deletions

View file

@ -1,20 +1,5 @@
{...}: let
extraConfig = ''
output "eDP-1" {
mode "1920x1200@60.018"
scale 1.0
focus-at-startup
position x=0 y=0
transform "normal"
}
window-rule {
match app-id="apps.regreet"
open-on-output "eDP-1"
}
'';
in {
{...}: {
youthlic.gui = {
enabled = "niri";
niri.extraConfig = extraConfig;
};
}

View file

@ -1,26 +1,5 @@
{...}: let
extraConfig = ''
output "DP-3" {
mode "2560x1440@169.900"
scale 1.0
position x=0 y=0
transform "normal"
focus-at-startup
}
output "eDP-1" {
mode "2560x1440@165.003"
scale 1.5
position x=2560 y=0
transform "normal"
}
window-rule {
match app-id="apps.regreet"
open-on-output "DP-3"
}
'';
in {
{...}: {
youthlic.gui = {
enabled = "niri";
niri.extraConfig = extraConfig;
};
}

View file

@ -8,9 +8,6 @@
in {
options = {
youthlic.gui.niri = {
extraConfig = lib.mkOption {
type = lib.types.str;
};
};
};
config = lib.mkIf (cfg.enabled == "niri") {
@ -86,27 +83,8 @@ in {
enable = true;
};
services = {
greetd = let
niriConfig = pkgs.writeText "greetd-niri-config.kdl" (''
binds {}
hotkey-overlay {
skip-at-startup
}
gestures {
hot-corners {
off
}
}
spawn-at-startup "${lib.getExe pkgs.swaybg}" "-i" "${config.stylix.image}"
''
+ config.youthlic.gui.niri.extraConfig);
in {
greetd = {
enable = true;
settings = {
default_session = {
command = "env GTK_USE_PORTAL=0 GDK_DEBUG=no-portals ${lib.getExe' config.programs.niri.package "niri"} --config ${niriConfig} -- ${lib.getExe config.programs.regreet.package}";
};
};
};
xserver = {
enable = true;
@ -119,6 +97,7 @@ in {
programs = {
regreet = {
enable = true;
cageArgs = ["-s" "-m" "last"];
};
niri = {
enable = true;