From 963d65ea1471f599a11803e730fa738e2878e611 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 12 May 2008 12:27:23 +0000 Subject: allow to disable D-Bus usage by setting NET_APPLET_DBUS=no in /etc/sysconfig/drakx-net (saves about 5200 kB of RSS memory) this disables Interactive Firewall and switching wireless network in the background without being root --- bin/net_applet | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/net_applet b/bin/net_applet index c48612a..05a2a37 100755 --- a/bin/net_applet +++ b/bin/net_applet @@ -25,6 +25,7 @@ use Gtk2::TrayIcon; use ugtk2 qw(:create :helpers :wrappers :dialogs); my $onstartupfile = "$ENV{HOME}/.net_applet"; +my $system_file = '/etc/sysconfig/drakx-net'; shouldStart() or die "$onstartupfile should be set to TRUE or use net_applet --force\n"; #- Allow multiple instances, but only one per user: @@ -51,6 +52,8 @@ my %pixbufs = ); my %wireless_networks; +my %global_settings = getVarsFromSh($system_file); + sub get_state_message { my ($o_interface) = @_; my $interface = $o_interface || $current_interface; @@ -145,7 +148,7 @@ gtkadd(my $icon = Gtk2::TrayIcon->new("Net_Applet"), $icon->show_all; my ($dbus, $monitor, $ifw, $interactive_cb, $ifw_alert); -eval { $dbus = dbus_object::system_bus() }; +eval { $dbus = dbus_object::system_bus() } if !defined($global_settings{NET_APPLET_DBUS}) || text2bool($global_settings{NET_APPLET_DBUS}); eval { $monitor = network::monitor->new($dbus) } if $dbus; eval { $ifw = network::ifw->new($dbus, sub { -- cgit v1.2.1