From cbe360bb8393d5239a97b343ae1ffbc18846673b Mon Sep 17 00:00:00 2001 From: jamie Date: Thu, 30 Apr 2026 21:06:47 +0100 Subject: [PATCH] treewide: use xdg.autostart.entries for autostart files (#2218) Link: https://github.com/nix-community/stylix/pull/2218 Closes: https://github.com/nix-community/stylix/issues/2287 Reviewed-by: 0xda157 --- modules/gnome/hm.nix | 17 +++++++++++------ modules/kde/hm.nix | 19 ++++++++++++------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/modules/gnome/hm.nix b/modules/gnome/hm.nix index 8a0fdecc..6e34099f 100644 --- a/modules/gnome/hm.nix +++ b/modules/gnome/hm.nix @@ -137,12 +137,17 @@ mkTarget { }; # Enable the extension after logging in. - configFile."autostart/stylix-activate-gnome.desktop".text = '' - [Desktop Entry] - Type=Application - Exec=${lib.getExe activator} enable - Name=Stylix: enable User Themes extension for GNOME Shell - ''; + autostart = { + enable = true; + entries = lib.singleton ( + pkgs.makeDesktopItem { + name = "stylix-activate-gnome"; + desktopName = "Stylix: enable User Themes extension for GNOME Shell"; + exec = "${lib.getExe activator} enable"; + } + + /share/applications/stylix-activate-gnome.desktop + ); + }; }; } ) diff --git a/modules/kde/hm.nix b/modules/kde/hm.nix index ec5614bc..7a3920b5 100644 --- a/modules/kde/hm.nix +++ b/modules/kde/hm.nix @@ -438,13 +438,18 @@ in # This desktop entry will run the theme activator when a new Plasma session is started # Note: This doesn't run again if a new homeConfiguration is activated from a running Plasma session - configFile."autostart/stylix-activate-kde.desktop".text = '' - [Desktop Entry] - Type=Application - Exec=${activator} - Name=Stylix: activate KDE theme - X-KDE-AutostartScript=true - ''; + autostart = { + enable = true; + entries = lib.singleton ( + pkgs.makeDesktopItem { + name = "stylix-activate-kde"; + desktopName = "Stylix: activate KDE theme"; + exec = activator; + extraConfig.X-KDE-AutostartScript = "true"; + } + + /share/applications/stylix-activate-kde.desktop + ); + }; }; }; }