From 786cdbf9795ff610f587cb8e91fb9dd28455e93d Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Tue, 8 Oct 2024 13:41:55 +0200 Subject: [PATCH] home/programs/niri: turn xwayland-satellite into systemd service --- home/programs/niri/default.nix | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/home/programs/niri/default.nix b/home/programs/niri/default.nix index 63dcbb2..cfa373a 100644 --- a/home/programs/niri/default.nix +++ b/home/programs/niri/default.nix @@ -1,5 +1,7 @@ { inputs, + lib, + pkgs, nixosConfig, ... }: let @@ -51,7 +53,25 @@ in { center-focused-column = "always"; always-center-single-column = true; }; - spawn-at-startup = [{command = ["xwayland-satellite"];}]; + }; + }; + + # copied from https://github.com/linyinfeng/dotfiles/blob/c00fe3b1562ad947672863a43e455bc2f01a56b6/home-manager/profiles/niri/default.nix#L594-L611 + systemd.user.services.xwayland-satellite = { + Unit = { + PartOf = ["graphical-session.target"]; + After = ["graphical-session.target"]; + Requisite = ["graphical-session.target"]; + }; + Install = { + WantedBy = ["niri.service"]; + }; + Service = { + Type = "simple"; + ExecStart = "${lib.getExe pkgs.xwayland-satellite} :0"; + NotifyAccess = "all"; + StandardOutput = "journal"; + Restart = "on-failure"; }; }; }