sway: signal on launch to systemd that the graphical-session.target is ready

this allows auto-launching of other services which require a compositor (i.e. messaging apps)
This commit is contained in:
2024-02-02 14:20:30 +00:00
parent 567c7993b6
commit 483a1d1780
2 changed files with 19 additions and 0 deletions

View File

@@ -340,6 +340,20 @@ in
})
];
sane.user.services.sway-session = {
description = "no-op unit to signal that sway is operational";
documentation = [
"https://github.com/swaywm/sway/issues/7862"
"https://github.com/alebastr/sway-systemd"
];
bindsTo = [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${pkgs.coreutils}/bin/true";
Type = "oneshot";
RemainAfterExit = true;
};
};
sane.user.fs = {
".config/waybar/config".symlink.target =
(pkgs.formats.json {}).generate "waybar-config.json" [

View File

@@ -199,4 +199,9 @@ output "Unknown 0x0637 0x00000000" {
# for more, see: <repo:nixos/nixpkgs:nixos/modules/programs/wayland/sway.nix>
include /etc/sway/config.d/*
# signal to systemd that sway is active,
# and therefore let it start the graphical-session target
# see `systemctl --user cat sway-session` for links to docs
exec --no-startup-id systemctl start --user sway-session.service
@extra_lines@