[opensuse-factory] enabling nm-applet only if NetworkManager is used
Hi, I installed todays Leap 15 snapshot in a VM and -- again -- was slightly annoyed, that nm-applet was started in the xfce desktop even though NetworkManager is not running at all. Now the /etc/xdg/autostart/nm-applet.desktop file that causes it to start in every desktop but GNOME and KDE is static, and AFAICT .desktop files have no notion of dependencies. Then I got an idea: some service during system boot (early boot) that basically does if systemctl is-enabled NetworkManager; then ln -s /usr/share/applications/nm-applet.desktop \ /etc/xdg/autostart/nm-applet.desktop 2>/dev/null else rm -f /etc/xdg/autostart/nm-applet.desktop fi and just not include /etc/xdg/autostart/nm-applet.desktop (or as %ghost) in the nm-applet package. This looks surprisingly simple, so I'm wondering if I'm overlooking something and this is in reality plain stupid. Opinions? I'd really like to get rid of the nm-applet icon for XFCE installations that only have wicked-managed interfaces. Note that it would still be possible for users to individually configure nm-applet to start via ~/.config/autostart, just the default would be changed to "only start nm-applet if NetworkManager is running". -- Stefan Seyfried "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." -- Richard Feynman -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 02/03/18 05:05, Stefan Seyfried wrote:
Hi,
I installed todays Leap 15 snapshot in a VM and -- again -- was slightly annoyed, that nm-applet was started in the xfce desktop even though NetworkManager is not running at all.
Now the /etc/xdg/autostart/nm-applet.desktop file that causes it to start in every desktop but GNOME and KDE is static, and AFAICT .desktop files have no notion of dependencies.
Then I got an idea:
some service during system boot (early boot) that basically does
if systemctl is-enabled NetworkManager; then ln -s /usr/share/applications/nm-applet.desktop \ /etc/xdg/autostart/nm-applet.desktop 2>/dev/null else rm -f /etc/xdg/autostart/nm-applet.desktop fi
and just not include /etc/xdg/autostart/nm-applet.desktop (or as %ghost) in the nm-applet package.
In enlightenment we were doing this manually at firstrun if Network Manager is enabled add nm-applet to autostart, but enlightenment makes it easy to write first run code. The problem with the approach your suggesting is desktops like KDE don't use nm-applet but will still show it if it is running. So we don't really want a service to do that, unless it can be run as a user service and also check the desktop the user is using. -- Simon Lees (Simotek) http://simotek.net Emergency Update Team keybase.io/simotek SUSE Linux Adelaide Australia, UTC+10:30 GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B
Hi Simon, On 02.03.2018 11:19, Simon Lees wrote:
On 02/03/18 05:05, Stefan Seyfried wrote:
Hi,
I installed todays Leap 15 snapshot in a VM and -- again -- was slightly annoyed, that nm-applet was started in the xfce desktop even though NetworkManager is not running at all.
Now the /etc/xdg/autostart/nm-applet.desktop file that causes it to start in every desktop but GNOME and KDE is static, and AFAICT .desktop files have no notion of dependencies.
Then I got an idea:
some service during system boot (early boot) that basically does
if systemctl is-enabled NetworkManager; then ln -s /usr/share/applications/nm-applet.desktop \ /etc/xdg/autostart/nm-applet.desktop 2>/dev/null else rm -f /etc/xdg/autostart/nm-applet.desktop fi
and just not include /etc/xdg/autostart/nm-applet.desktop (or as %ghost) in the nm-applet package.
In enlightenment we were doing this manually at firstrun if Network Manager is enabled add nm-applet to autostart, but enlightenment makes it easy to write first run code.
And if network manager is enabled later on, the user (every user on this machien) has to find out how to enable nm-applet also?
The problem with the approach your suggesting is desktops like KDE don't use nm-applet but will still show it if it is running.
Then they would already show it today. /etc/xdg/autostart/nm-applet.desktop is right now contained in nm-applet.rpm
So we don't really want a service to do that, unless it can be run as a user service and also check the desktop the user is using.
You did not convince me yet :-) Your enlightenment case would still work as before, and all other desktops than GNOME,KDE (where nm-applet.desktop prevents its start) would benefit from a nicer default IMHO. -- Stefan Seyfried "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." -- Richard Feynman -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (2)
-
Simon Lees
-
Stefan Seyfried