Bug 373891

Summary: Autostart option is without effect on non-KDE desktop
Product: [Applications] kgpg Reporter: Florian Lindner <florian.lindner>
Component: generalAssignee: Rolf Eike Beer <kde>
Status: CONFIRMED ---    
Severity: normal CC: daniel090189, dhgutteridge, krferriter, oceanofsolaris
Priority: NOR    
Version: 16.12   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Florian Lindner 2016-12-19 14:49:52 UTC
etc/xdg/autostart/org.kde.kgpg.desktop contains

X-KDE-autostart-after=panel
X-KDE-autostart-condition=kgpgrc:User Interface:AutoStart:false

This two options are only evaluated by KDE. Therefore, if you use another platform than KDE, kgpg always autostarts

https://specifications.freedesktop.org/autostart-spec/0.5/ar01s02.html says:

If an application autostarts by having a .desktop file installed in the system wide autostart directory, an individual user can disable the autotomatic start of this application by placing a .desktop file of the same name in its personal autostart directory which contains the key Hidden=true.

See also similiar issue with kalarm: https://bugs.kde.org/show_bug.cgi?id=366562
Comment 1 Stephan Burkhardt 2016-12-27 08:47:25 UTC
I also encountered this problem and it is somewhat annoying, since I have kgpg Autostart and bother me with the first start assistant every time I log into Gnome.

I have solved it by adding the following line to the file /etc/xdg/autostart/org.kde.kgpg.desktop:
OnlyShowIn=KDE;

This is what is found in most other KDE applications inside this autostart folder in my distribution (Arch Linux).
Would it be possible to add this line by default? This would tremendously improve the user experience for non-KDE users on systems where it is installed, since there is no user-accessible way to disable the auto-start right now.
Comment 2 David H. Gutteridge 2017-02-28 23:03:29 UTC
I'm also seeing this issue. KAlarm previously had the same problem. (https://bugs.kde.org/show_bug.cgi?id=366562).
Comment 3 Kyle Ferriter 2019-06-12 22:29:31 UTC
This issue is still there, the line 

OnlyShowIn=KDE;

needs to be added to org.kde.kgpg.desktop so it isn't started in other environments.  As Stephan said this line is already present in the other KDE-specific desktop files.
Comment 4 Florian Lindner 2019-06-13 07:22:02 UTC
> This issue is still there, the line OnlyShowIn=KDE; needs to be added to org.kde.kgpg.desktop so it isn't started in other environments.

If I understand the XDG autostart stuff correctly, it will no longer autostart kgpg on non-KDE environments, but will also disable autostart if it's desired, i.e. the option in kgpg is set.

IMO the entire scheme is ill-designed. Checking / unchecking the option should directly set/unset the "Hidden" attribute in ~/.config/autostart/kgpg.desktop. This way, it would work for any desktop environment.