Bug 433987

Summary: Login scripts don't start in systemd mode
Product: [Applications] systemsettings Reporter: gudvinr+kde
Component: kcm_autostartAssignee: David Edmundson <kde>
Status: RESOLVED FIXED    
Severity: normal CC: kde.podagric, nate, plasma-bugs
Priority: NOR    
Version: 5.21.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=433299
Latest Commit: Version Fixed In: 5.22

Description gudvinr+kde 2021-03-05 08:26:54 UTC
SUMMARY

I have couple of scripts added to "Login scripts" section in Autostart settings. They don't start anymore after I switched to systemd mode.
I tried to remove and add them but it didn't work either.

STEPS TO REPRODUCE
1. Add script to Login scripts section
2. Boot system

OBSERVED RESULT

Login scripts executed and produced some useful result

EXPECTED RESULT

No useful result were seen after boot

SOFTWARE/OS VERSIONS

Operating System: Arch Linux
KDE Plasma Version: 5.21.2
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
OS Type: 64-bit
Graphics Platform: X11
Comment 1 David Edmundson 2021-03-06 01:01:55 UTC
Urgh, we have two sets of login script.

We do call runEnvironmentScripts()

but I don't have an equivalent of 
StartupPhase2::runUserAutostart

---

We have a few options:

We could make a tiny binary that executes those scripts, then provide a .desktop file that runs this in autostart phase 2. 
then we can remove the specific code from the legacy boot, and both can share this and have it "just work" for both.

----

We could make a custom generator, somewhat like the apps autostart

----

Maybe the KCM should create .desktop files with the Exec line porting to the script, rather than copying things into a specific dir. Then we get to attach metadata to the script and we reduce our code paths here.
Comment 2 David Edmundson 2021-03-06 01:02:15 UTC
*** Bug 433133 has been marked as a duplicate of this bug. ***
Comment 3 gudvinr+kde 2021-03-10 09:45:01 UTC
You could just create systemd unit file that depends on KDE
Comment 4 Nate Graham 2021-04-28 17:06:34 UTC
Fixed by Henri Chain with https://invent.kde.org/plasma/plasma-workspace/-/commit/93f9ef0304f300dc3952ac9a25cbd82996eec263 in Plasma 5.22!