Bug 413053

Summary: Can't remove Discover Update Notifier from System Tray
Product: [Applications] Discover Reporter: Sebastian Friedl <sfr682k>
Component: NotifierAssignee: Aleix Pol <aleixpol>
Status: RESOLVED FIXED    
Severity: normal CC: aleixpol, cappelikan, kde, nate, piotr.mierzwinski, postix, priit, putr4.s, qydwhotmail, rdieter, rikmills, s1r51ckb01
Priority: NOR Keywords: usability
Version: 5.27.7   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=416193
https://bugs.kde.org/show_bug.cgi?id=454422
Latest Commit: Version Fixed In: 6.0
Sentry Crash Report:

Description Sebastian Friedl 2019-10-16 19:21:45 UTC
SUMMARY
There used to be a checkbox in the system tray's settings, which could be used to remove Discover's Update Notifier from the system tray. With 5.17, this checkbox seems to be gone.

STEPS TO REPRODUCE
1. Open the system tray's settings

OBSERVED RESULT
There is no button for disabling the Update Notifier

EXPECTED RESULT
The Update Notifier may be disabled by unchecking a check box

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.17.0
KDE Frameworks Version: 5.63.0
Qt Version: 5.13.1
Kernel Version: 5.3.6-arch1-1-ARCH
OS Type: 64-bit
Comment 1 Nate Graham 2019-10-16 22:01:41 UTC
Yeah, this is a side effect of it being an executable rather than a system tray applet.
Comment 2 s1r51ckb01 2019-10-18 09:05:30 UTC
(In reply to Nate Graham from comment #1)
> Yeah, this is a side effect of it being an executable rather than a system
> tray applet.


Hi Nate first of all congratulations as always for the excellent work you do to create and make always better Kde.
I would like to ask you how you could disable this behavior?
The "/usr/lib/DiscoverNotifier" process starts with "CGroup: /user.slice/user-1000.slice/session-2.scope"
Comment 3 David Edmundson 2019-10-18 13:03:06 UTC
You should see a combo box under "Entries" which can be set to Hidden.

Does this work?
Comment 4 Nate Graham 2019-10-18 13:04:46 UTC
I think Sebastian wants the ability to remove it entirely, not just banish it to the expanded popup.
Comment 5 Sebastian Friedl 2019-10-19 07:26:46 UTC
(In reply to Nate Graham from comment #4)
> I think Sebastian wants the ability to remove it entirely, not just banish
> it to the expanded popup.

That's right.

I've disabled the expanded popup so I could see all tray icons.
Setting Discover's entry to "Hidden" would require to disable the "Show all entries" option and set all other entries to "Always shown".
Comment 6 Rik Mills 2019-10-23 13:00:28 UTC
It is of course possible to right click the icon, and select 'quit'.

However, I guess the biggest issue here is that there is no GUI way to prevent the DiscoverNotifier autostarting with plasma as could be done when it was an applet. There is no way to do it via the system tray, and the notifier does not show up in any class of startup items in systemsettings.
Comment 7 Aleix Pol 2019-10-23 16:25:24 UTC
A way to disable it forever is to run something like:

$ cp /home/apol/devel/kde5/etc/xdg/autostart/org.kde.discover.notifier.desktop ~/.local/share/autostart
$ echo "Hidden=true" >> ~/.local/share/autostart/org.kde.discover.notifier.desktop

I can look into adding some UX to make that happen for 5.18, it's not really possible to do it right without new strings.
Comment 8 Aleix Pol 2019-10-23 16:29:22 UTC
Git commit 87e145613d161dc9ebf2ab1fbc049840c2b87e2a by Aleix Pol.
Committed on 23/10/2019 at 16:29.
Pushed by apol into branch 'master'.

notifier: make it possible to have the notifier hidden

But still regularly check for updates

M  +1    -1    notifier/CMakeLists.txt
M  +0    -2    notifier/DiscoverNotifier.cpp
A  +106  -0    notifier/NotifierItem.cpp     [License: GPL (v2/3)]
A  +46   -0    notifier/NotifierItem.h     [License: GPL (v2/3)]
M  +25   -60   notifier/main.cpp

https://commits.kde.org/discover/87e145613d161dc9ebf2ab1fbc049840c2b87e2a
Comment 9 s1r51ckb01 2019-10-28 08:49:25 UTC
As commented by Aleix Pol I solved by adding to the bottom of the file: /etc/xdg/autostart/org.kde.discover.notifier.desktop
the string: Hidden=True
When restarting, the icon does not appear in the system tray and the process does not start automatically
Comment 10 Nate Graham 2020-01-14 23:13:00 UTC
Aleix, did your last commit fix this? Or is there still something left to do?
Comment 11 Rik Mills 2020-01-18 12:51:55 UTC
(In reply to Nate Graham from comment #10)
> Aleix, did your last commit fix this? Or is there still something left to do?

No, as there is no way to _persistently_ disable it. This was possible to do when it was an applet.
Comment 12 Aleix Pol 2020-01-20 14:25:48 UTC
Running "/usr/lib/libexec/DiscoverNotifier --hide" should prevent it from showing up again.

If you don't want it to start at all, its autostart needs to be disabled.
Comment 13 Aleix Pol 2020-01-20 14:29:28 UTC
If we want an in-between solution for the notification, we could add the possibility to silence it for an $amount-of-time.

Or it could be something that could be added generically to KNotifications?
Comment 14 Nate Graham 2020-01-20 18:02:49 UTC
(In reply to Aleix Pol from comment #12)
> Running "/usr/lib/libexec/DiscoverNotifier --hide" should prevent it from
> showing up again.
> 
> If you don't want it to start at all, its autostart needs to be disabled.
I don't see an entry for it in the autostart KCM.

IMO we should probably expose this in Discover's own settings too, along with the frequency with which it checks for updates.
Comment 15 soredake 2020-08-17 13:46:00 UTC
having xdg autostart entries in autostart kcm module will be very useful, configurable update interval in discover is too (or even controling apt built-in update interval)
Comment 16 soredake 2020-12-04 11:00:55 UTC
Any progress on this?
Comment 17 Antonio Rojas 2021-02-03 08:09:47 UTC
*** Bug 432439 has been marked as a duplicate of this bug. ***
Comment 18 Piotr Mierzwinski 2021-02-03 18:00:13 UTC
For those who use Arch based distributions. 
In below url you will find some work around how to fix this issue. Shortly: update of pacman.conf by adding a rule to skip desktop (org.kde.discover.notifier.desktop) file in moment of extracting of package.
https://www.reddit.com/r/kde/comments/lavors/getting_rid_of_discover_keeps_popping_back_up/
Comment 19 Nate Graham 2021-06-02 18:01:10 UTC
FWIW I've discovered that openSUSE and Fedora are splitting the notifier into a separate package to allow users who don't want tho notifier to remove it. This is a pretty heavyweight solution, and I think we can make life easier for them and our users by making this an option native to Discover itself. It would probably make sense to do at the same time as Bug 416193; if the update interval is set to "Never", or there are simply no updates available, the Notifier could automatically disappear, for example.
Comment 20 Nate Graham 2022-06-28 18:31:31 UTC
*** Bug 456069 has been marked as a duplicate of this bug. ***
Comment 21 cappelikan 2023-08-10 19:22:17 UTC
there was an error with the non-disappearing icon after the update, you have to forcefully close it manually

Operating System: KDE neon 5.27
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10
Graphics Platform: X11
Comment 22 deemon 2023-12-15 09:04:55 UTC
I would like to see an option for actually DISABLING it. Being hidden is not good enough -- I don't want the process `/usr/lib/DiscoverNotifier` even launch. Ever. (while at the same time not uninstalling the entire Discover for achieving this)
Comment 23 Rik Mills 2023-12-15 10:49:24 UTC
(In reply to Nate Graham from comment #19)
> FWIW I've discovered that openSUSE and Fedora are splitting the notifier
> into a separate package to allow users who don't want tho notifier to remove
> it. 

In Plasma 5.27 this is also the case in K/Ubuntu, by removing the package plasma-discover-notifier.
Comment 24 Bug Janitor Service 2023-12-19 07:03:35 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/discover/-/merge_requests/721
Comment 25 Bug Janitor Service 2024-01-07 18:35:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/discover/-/merge_requests/729
Comment 26 fanzhuyifan 2024-01-09 16:49:59 UTC
Git commit 0ab7b2c87fcbb4c144fcea917809b8dd67f35d0d by Yifan Zhu.
Committed on 09/01/2024 at 17:31.
Pushed by apol into branch 'master'.

notifier: only show applet when necessary

Only show the notifier applet when there are interesting things to
notify about:
- update notifications
- pending reboot
- and ongoing updates.

M  +51   -26   notifier/NotifierItem.cpp
M  +8    -4    notifier/NotifierItem.h
M  +1    -1    notifier/main.cpp

https://invent.kde.org/plasma/discover/-/commit/0ab7b2c87fcbb4c144fcea917809b8dd67f35d0d