<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 14 Mar 2012, at 15:57, Steve Cookson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta content="text/html; charset=us-ascii" http-equiv="Content-Type">
<meta name="GENERATOR" content="MSHTML 8.00.6001.19190">
<div style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<div dir="ltr" align="left">As I understand it, HAL is officially deprecated. It's
only included in distros now to support old code which hasn't yet been made udev
aware. It depends on what you mean by 'be able to use HAL', but I would suggest
you start removing any dependence you have on it ASAP.</div><font size="2" face="Verdana"></font>
<div><br><span class="375315415-14032012"><font size="2" face="Verdana">Hi
Mark,</font></span></div>
<div><span class="375315415-14032012"><font size="2" face="Verdana"></font></span> </div>
<div><span class="375315415-14032012"><font size="2" face="Verdana">Thanks for
this. I have a piece of HAL code which give me some details about USBs
which I parse to get mounting info. I tried other source, but it didn't
all appear to be there.</font></span></div>
<div><span class="375315415-14032012"><font size="2" face="Verdana"></font></span> </div>
<div><span class="375315415-14032012"><font size="2" face="Verdana">This what I have
now:</font></span></div>
<div><span class="375315415-14032012"><font size="2" face="Verdana"></font></span> </div>
<div><span class="375315415-14032012"><font size="2" face="Verdana">#!/bin/ksh93<br>#<br># list attached USB storage
devices<br>#</font></span></div>
<div> </div>
<div><span class="375315415-14032012"><font size="2" face="Verdana">for udi in
$(/usr/bin/hal-find-by-capability --capability
storage)<br>do<br> device=$(hal-get-property --udi $udi --key
block.device)<br> #device2=$(hal-get-property --udi $udi --key
block.storage_device)<br> vendor=$(hal-get-property --udi $udi
--key storage.vendor)<br> model=$(hal-get-property --udi $udi
--key storage.model)<br> product=$(hal-get-property --udi $udi
--key info.product)<br> #dev=$(hal-get-property --udi $device2
--key linux.sysfs_path)<br> if [[ $(hal-get-property --udi
$udi --key storage.bus) = "usb" ]]<br>
then<br>
parent_udi=$(hal-find-by-property --key block.storage_device --string
$udi)<br> mount=$(hal-get-property
--udi $parent_udi --key
volume.mount_point)<br>
label=$(hal-get-property --udi $parent_udi --key
volume.label)<br>
media_removable=$(hal-get-property --udi $udi --key
storage.removable)<br>
media_size=$(hal-get-property --udi $udi --key
storage.removable.media_size)<br>
size=$(( ceil(media_size/(1000*1000*1000))
))<br> printf
"-------------------------------------------------\n"<br>
printf "Vendor: $vendor\n"<br> printf
"Model: $model\n"<br> printf
"Device: $device\n"<br> printf
"Product: $product\n"<br> printf
"Mount: $mount\n"<br> printf
"Size "${size}" GB \n"<br> printf
"Removable: $media_removable\n"<br>
#printf "Dev: $dev\n"<br> fi<br>done<br></font></span></div>
<div><span class="375315415-14032012"><font size="2" face="Verdana">But it is not
clear to me how I might get the same attributes from udev.</font></span></div></div></blockquote><div><br></div><div>I'm no expert but I know KDE uses disks now so it must be possible. There must be a udev mailing list you could try.</div><div><br></div><div>Mark</div><div><br></div><br><blockquote type="cite"><div style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<div><span class="375315415-14032012"><font size="2" face="Verdana"></font></span> </div>
<div><span class="375315415-14032012"><font size="2" face="Verdana">Regards</font></span></div>
<div><span class="375315415-14032012"><font size="2" face="Verdana"></font></span> </div>
<div><span class="375315415-14032012"><font size="2" face="Verdana">Steve</font></span></div></div>
-- <br>kubuntu-users mailing list<br><a href="mailto:kubuntu-users@lists.ubuntu.com">kubuntu-users@lists.ubuntu.com</a><br>Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/kubuntu-users<br></blockquote></div><br></body></html>