diff options
-rwxr-xr-x | draksnapshot-applet | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/draksnapshot-applet b/draksnapshot-applet index 27b5dc1..54eaa19 100755 --- a/draksnapshot-applet +++ b/draksnapshot-applet @@ -80,6 +80,7 @@ my $dbus = dbus_object::system_bus(); my $do = dbus_object->new($dbus, $hal_dn, $manager_path, $hal_manager); my $con = $dbus->{connection}; +my $old_time; $con->add_filter(sub { my ($_bus, $msg) = @_; return if $msg->get_member ne 'DeviceAdded'; @@ -90,7 +91,9 @@ $con->add_filter(sub { $bool = $device->QueryCapability('block') && $device->GetProperty('block.is_volume'); }; if ($bool) { - go2State('disk_found'); + my $time = time(); + go2State('disk_found') if 5 < abs($time - $old_time); + $old_time = $time; } 0; }); |