Skip to content

Commit

Permalink
hyprland: add support for XDG autostart using systemd
Browse files Browse the repository at this point in the history
Using the option

    wayland.windowManager.hyprland.systemd.enableXdgAutostart

users can now choose to start applications present in
`$XDG_CONFIG_HOME/autostart` when starting their sway session.

See 0144ac4 and
#3747
  • Loading branch information
Scrumplex authored and rycee committed May 10, 2024
1 parent 2237433 commit f55718a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/services/window-managers/hyprland.nix
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ in {
];
description = "Extra commands to be run after D-Bus activation.";
};

enableXdgAutostart = lib.mkEnableOption ''
autostart of applications using
{manpage}`systemd-xdg-autostart-generator(8)`'';
};

xwayland.enable = lib.mkEnableOption "XWayland" // { default = true; };
Expand Down Expand Up @@ -247,8 +251,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.enableXdgAutostart
"xdg-desktop-autostart.target";
After = [ "graphical-session-pre.target" ];
Before = lib.mkIf cfg.systemd.enableXdgAutostart
[ "xdg-desktop-autostart.target" ];
};
};

Expand Down

0 comments on commit f55718a

Please sign in to comment.