http://qs321.pair.com?node_id=11104562


in reply to net::dbus example

another other method, if it is working
Run dbus-monitor and it will react for you. Small stand-alone example:
dbus-monitor --system "type='signal',sender='org.freedesktop.UDisk +s2',interface='org.freedesktop.DBus.Properties'" | perl -lne' if (/^\s+ ([[:xdigit:]]{2} \s)+/msx) { $r .= $_; } elsif (/\s+\]/ && $r) { my $mount = join "", map { chr hex $_ } grep { !!$_ && $_ +ne "00" } split /\s+/, $r; system "xdg-open", $mount; $r = ""; } '