Bug 455889

Summary: Parse autostarted .desktop files and display any errors in the UI
Product: [Applications] systemsettings Reporter: Nate Graham <nate>
Component: kcm_autostartAssignee: Nicolas Fella <nicolas.fella>
Status: RESOLVED FIXED    
Severity: wishlist CC: hsantanna, plasma-bugs, sthenujan2002
Priority: NOR Keywords: usability
Version: master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=455252
Latest Commit: Version Fixed In: 6.0

Description Nate Graham 2022-06-24 14:12:10 UTC
When using Systemd boot, the XDG .desktop file parser is used, and it's stricter than what we use in KDE, so some slightly malformed .desktop files fail to pass vlaidation and their apps no longer autostart, without any error message or explanation.

Even if the XDG parser is changed to be less strict, we should still parse the .desktop file for anything in the KCM and display errors to the user there, so that they know which of the entries there will fail to autostart, why, and who is to blame.

See also Bug 455252.
Comment 1 thenujan 2023-07-21 05:17:31 UTC
(In reply to Nate Graham from comment #0)
> When using Systemd boot, the XDG .desktop file parser is used, and it's
> stricter than what we use in KDE, so some slightly malformed .desktop files
> fail to pass vlaidation and their apps no longer autostart, without any
> error message or explanation.
> 
> Even if the XDG parser is changed to be less strict, we should still parse
> the .desktop file for anything in the KCM and display errors to the user
> there, so that they know which of the entries there will fail to autostart,
> why, and who is to blame.
> 
> See also Bug 455252.

Is this for handwritten desktop files that were added to .config/autostart manually?
If the user added a script or application to autostart using the kcm, then the desktop file shouldn't have malformed entries.
Comment 2 Nate Graham 2023-07-24 21:51:05 UTC
I don't know. But since .desktop flies are just text, there's always the possibility of a malformed file, whether because it was handmade, or made by an app that used a buggy library, or  there was a mismatch between what the library used by an app wrote out and what xdg-autostart-generator supports. Lots of reasons why things could go wrong.
Comment 3 Nate Graham 2023-08-14 15:33:13 UTC
Git commit e54bd896ce1e8daaeb29b67d6e40c95ec83c5db5 by Nate Graham, on behalf of Thenujan Sandramohan.
Committed on 14/08/2023 at 17:33.
Pushed by ngraham into branch 'master'.

kcms/autostart: Show more info about systemd-backed entries

This MR gets info about autostart systemd units using dbus and shows them
on a new sub-page in the KCM. This will make it easy for people to figure
out why their autostart entries aren't autostarting or debug other issues.
Related: bug 401536, bug 391609
FIXED-IN: 6.0

M  +3    -1    CMakeLists.txt
M  +17   -2    kcms/autostart/CMakeLists.txt
M  +2    -1    kcms/autostart/autostart.cpp
M  +61   -4    kcms/autostart/autostartmodel.cpp
M  +17   -0    kcms/autostart/autostartmodel.h
A  +127  -0    kcms/autostart/ui/entry.qml     [License: GPL(v2.0+)]
M  +107  -52   kcms/autostart/ui/main.qml
A  +249  -0    kcms/autostart/unit.cpp     [License: GPL(v2.0+)]
A  +64   -0    kcms/autostart/unit.h     [License: GPL(v2.0+)]

https://invent.kde.org/plasma/plasma-workspace/-/commit/e54bd896ce1e8daaeb29b67d6e40c95ec83c5db5