1 { config, lib, pkgs, ... }:
4 runXdgAutostart = config.services.xserver.desktopManager.runXdgAutostartIfNone;
8 services.xserver.desktopManager.runXdgAutostartIfNone = mkOption {
12 Whether to run XDG autostart files for sessions without a desktop manager
13 (with only a window manager), these sessions usually don't handle XDG
14 autostart files by default.
16 Some services like {option}`i18n.inputMethod` and
17 {option}`service.earlyoom` use XDG autostart files to start.
18 If this option is not set to `true` and you are using
19 a window manager without a desktop manager, you need to manually start
20 them or running `dex` somewhere.
27 services.xserver.desktopManager.session = [
30 start = optionalString runXdgAutostart ''
31 /run/current-system/systemd/bin/systemctl --user start xdg-autostart-if-no-desktop-manager.target
36 (mkIf runXdgAutostart {
37 systemd.user.targets.xdg-autostart-if-no-desktop-manager = {
38 description = "Run XDG autostart files";
39 # From `plasma-workspace`, `share/systemd/user/plasma-workspace@.target`.
40 requires = [ "xdg-desktop-autostart.target" "graphical-session.target" ];
41 before = [ "xdg-desktop-autostart.target" "graphical-session.target" ];
42 bindsTo = [ "graphical-session.target" ];