From d660f260b87c22164f666c1c10e09ffcc94b86df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 7 Feb 2014 02:16:39 +0100 Subject: [PATCH] Hide nm-applet when NetworkManager is disabled (retry) It isn't done automatically by nm-applet itself since nm-applet 0.9.9.0 (fc19+), this one commit: https://git.gnome.org/browse/network-manager-applet/commit?id=276a702000ee9e509321891f5ffa9789acfb053c At the same time they've introduced option to manually hide the icon: https://git.gnome.org/browse/network-manager-applet/commit?id=e7331a3f33ab422ea6c1bbc015ad44d8d9c83bc3 --- Makefile | 3 +++ network/show-hide-nm-applet.desktop | 8 ++++++++ network/show-hide-nm-applet.sh | 6 ++++++ rpm_spec/core-vm.spec | 2 ++ 4 files changed, 19 insertions(+) create mode 100644 network/show-hide-nm-applet.desktop create mode 100644 network/show-hide-nm-applet.sh diff --git a/Makefile b/Makefile index 0566bb8..918f2f3 100644 --- a/Makefile +++ b/Makefile @@ -110,6 +110,9 @@ install-vm: install -m 0644 -D network/tinyproxy-qubes-yum.conf $(DESTDIR)/etc/tinyproxy/tinyproxy-qubes-yum.conf install -m 0644 -D network/filter-qubes-yum $(DESTDIR)/etc/tinyproxy/filter-qubes-yum install -m 0755 -D network/iptables-yum-proxy $(DESTDIR)/usr/lib/qubes/iptables-yum-proxy + install -d $(DESTDIR)/etc/xdg/autostart + install -m 0755 network/show-hide-nm-applet.sh $(DESTDIR)/usr/lib/qubes/show-hide-nm-applet.sh + install -m 0644 network/show-hide-nm-applet.desktop $(DESTDIR)/etc/xdg/autostart/qubes-show-hide-nm-applet.desktop install -d $(DESTDIR)/etc/yum.conf.d touch $(DESTDIR)/etc/yum.conf.d/qubes-proxy.conf diff --git a/network/show-hide-nm-applet.desktop b/network/show-hide-nm-applet.desktop new file mode 100644 index 0000000..181ca5f --- /dev/null +++ b/network/show-hide-nm-applet.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Version=1.0 +Encoding=UTF-8 +Name=Hide/Show nm-applet depending on NetworkManager state +Exec=/usr/lib/qubes/show-hide-nm-applet.sh +Terminal=false +Type=Application +OnlyShowIn=QUBES; diff --git a/network/show-hide-nm-applet.sh b/network/show-hide-nm-applet.sh new file mode 100644 index 0000000..80257b0 --- /dev/null +++ b/network/show-hide-nm-applet.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# Hide nm-applet when network-manager is disabled +nm_enabled=false +[ -f /var/run/qubes-service/network-manager ] && nm_enabled=true +gsettings set org.gnome.nm-applet show-applet $nm_enabled diff --git a/rpm_spec/core-vm.spec b/rpm_spec/core-vm.spec index 0534e66..4c38103 100644 --- a/rpm_spec/core-vm.spec +++ b/rpm_spec/core-vm.spec @@ -308,6 +308,7 @@ rm -f %{name}-%{version} %config(noreplace) /etc/tinyproxy/tinyproxy-qubes-yum.conf /etc/udev/rules.d/50-qubes-misc.rules /etc/udev/rules.d/99-qubes-network.rules +/etc/xdg/autostart/qubes-show-hide-nm-applet.desktop /etc/xdg/nautilus-actions/nautilus-actions.conf /etc/xen/scripts/vif-route-qubes %config(noreplace) /etc/yum.conf.d/qubes-proxy.conf @@ -328,6 +329,7 @@ rm -f %{name}-%{version} /usr/lib/qubes/sync-ntp-clock /usr/lib/qubes/prepare-suspend /usr/lib/qubes/network-manager-prepare-conf-dir +/usr/lib/qubes/show-hide-nm-applet.sh /usr/lib/qubes/qrexec-agent /usr/lib/qubes/qrexec-client-vm /usr/lib/qubes/qrexec_client_vm