summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdraksnapshot-applet17
1 files changed, 11 insertions, 6 deletions
diff --git a/draksnapshot-applet b/draksnapshot-applet
index bbe1d66..2c28075 100755
--- a/draksnapshot-applet
+++ b/draksnapshot-applet
@@ -75,6 +75,16 @@ my %actions = (
'configure' => { name => N("Configure"), launch => \&configure }
);
+
+# create status icon:
+my $icon = Gtk2::StatusIcon->new;
+$icon->signal_connect(popup_menu => sub {
+ my ($_icon, $button, $time) = @_;
+ $menu and $menu->popup(undef, undef, undef, undef, $button, $time);
+ });
+$icon->signal_connect(activate => \&configure);
+
+
my $hal_dn = 'org.freedesktop.Hal';
my $hal_manager = "$hal_dn.Manager";
my $manager_path = '/org/freedesktop/Hal/Manager';
@@ -105,12 +115,7 @@ $con->add_filter(sub {
});
$con->add_match("type='signal',interface='$hal_manager'");
-my $icon = Gtk2::StatusIcon->new;
-$icon->signal_connect(popup_menu => sub {
- my ($_icon, $button, $time) = @_;
- $menu and $menu->popup(undef, undef, undef, undef, $button, $time);
- });
-$icon->signal_connect(activate => \&configure);
+
my ($opt) = @ARGV;
if ($opt eq '--force' || $opt eq '-f') { setAutoStart('TRUE') }