Bug 373891 - Autostart option is without effect on non-KDE desktop
Summary: Autostart option is without effect on non-KDE desktop
Status: CONFIRMED
Alias: None
Product: kgpg
Classification: Applications
Component: general (show other bugs)
Version: 16.12
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Rolf Eike Beer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-19 14:49 UTC by Florian Lindner
Modified: 2024-06-16 16:25 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.
Comment 5 Eduard 2024-06-16 16:24:23 UTC
Hi! I am still facing this issue in 2024, using Xfce4 with KDE also installed.

But I can confirm that the workaround does indeed still help for me too, so that's great.

I copy the `org.kde.kgpg.desktop` file from the `/etc/xdg/autostart/` system location to my `~/.config/autostart/` home location and then I add the `Hidden=true` to the it.
It no longer launches.
(It's the same way as hiding applications in `/.local/share/applications/`, which hides the shortcut from my Xfce menus, but then for disabling automatic starting instead)

But still, this workaround should not be needed. Why does the file have to be in `/etc/xdg/autostart/` in the first place?

There's another desktop file, `org.kde.kclockd-autostart.desktop`, which is also simply added to my `~/.config/autostart/` location by KDE - also something I did not really expect, but at least it's in my home directory so I can directly modify it if I want.
Comment 6 Eduard 2024-06-16 16:25:17 UTC
Sorry I forgot to mention that I am using Arch Linux.