hyprland: add support for XDG autostart using systemd

Using the option `wayland.windowManager.hyprland.systemd.xdgAutostart`,
users can now choose to start applications present in
`$XDG_CONFIG_HOME/autostart` when starting their sway session.

See 0144ac418e and
https://github.com/nix-community/home-manager/pull/3747

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu 2024-02-09 18:09:33 +01:00
parent 5b9156fa9a
commit 74d0331c5b
No known key found for this signature in database
GPG Key ID: E13DFD4B47127951
1 changed files with 10 additions and 1 deletions

View File

@ -103,6 +103,11 @@ in {
];
description = "Extra commands to be run after D-Bus activation.";
};
xdgAutostart = lib.mkEnableOption ''
autostart of applications using
{manpage}`systemd-xdg-autostart-generator(8)`
'';
};
xwayland.enable = lib.mkEnableOption "XWayland" // { default = true; };
@ -262,8 +267,12 @@ in {
Description = "Hyprland compositor session";
Documentation = [ "man:systemd.special(7)" ];
BindsTo = [ "graphical-session.target" ];
Wants = [ "graphical-session-pre.target" ];
Wants = [ "graphical-session-pre.target" ]
++ lib.optional cfg.systemd.xdgAutostart
"xdg-desktop-autostart.target";
After = [ "graphical-session-pre.target" ];
Before =
lib.mkIf cfg.systemd.xdgAutostart [ "xdg-desktop-autostart.target" ];
};
};