Sophie

Sophie

distrib > Mandriva > current > i586 > media > contrib-release-src > by-pkgid > bf0cb782fe3d68c386e7a604ee7e5eba > files > 6

halevt-0.1.5-5mdv2010.1.src.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE halevt:Configuration [

<!-- this entity corresponds with mountable devices, which have 
 volume.policy.should_mount true or don't have 
 volume.policy.should_mount false and are block devices hotpluggable or
 removable.
-->
<!ENTITY MOUNTABLE "hal.block.device &amp; hal.block.is_volume = true &amp; (hal.volume.policy.should_mount = true | ((! hal.volume.policy.should_mount = false) &amp; (hal.block.storage_device.hal.storage.policy.should_mount = true | ((! hal.block.storage_device.hal.storage.policy.should_mount = false)  &amp; (hal.block.storage_device.hal.storage.hotpluggable = true | hal.block.storage_device.hal.storage.removable = true)))))">
]>
<halevt:Configuration version="0.1" xmlns:halevt="http://www.environnement.ens.fr/perso/dumas/halevt.html">

<!--
Remember to use &amp; and &quot; for & and " in xml attributes.

In a match attribute, hal.* is special since it matches any device.
In a match attribute property it is possible to refer to other
device properties. For example 
hal.block.storage_device.hal.storage.policy.should_mount
refers to the storage.policy.should_mount property of the block.storage_device
device associated with a given device.

In an exec attribute, $hal.udi$ is special since it is replaced by
the device udi. $hal.some.property$ is replaced by the value
of the property some.property.
!-->

<!--
Removable devices support
!-->

<!--
This rule matches removable devices which have volume.policy.should_mount true
or don't have volume.policy.should_mount false.
Upon insertion, they are mounted and recorded by halevt-mount. 
!-->
<halevt:Device match="&MOUNTABLE;">
   <halevt:Insertion exec="halevt-mount -u $hal.udi$ -o flush"/>
</halevt:Device>

<!--
When a device get a mount point, it is passed to halevt-mount which can 
record it. The property that changes is volume.is_mounted, and the action is
executed when the value of volume.is_mounted becomes true.
!-->
<halevt:Device match="hal.block.device &amp; hal.block.is_volume = true &amp; hal.volume.mount_point">
   <halevt:Property name="hal.volume.is_mounted">
      <halevt:Action value="true" exec="halevt-mount -s"/>
   </halevt:Property>
</halevt:Device>

<!-- Start halevt-explore-mount when mountable devices get mounted -->
<halevt:Device match="&MOUNTABLE;">
   <halevt:Property name="hal.volume.is_mounted">
      <halevt:Action value="true" exec="/usr/bin/halevt-explore-mount &quot;$hal.volume.mount_point$&quot;"/>
   </halevt:Property>
</halevt:Device>

<!--
When a device is unmounted, it is recorded by halevt-mount.
!-->
<halevt:Device match="hal.block.device &amp; hal.block.is_volume = true">
    <halevt:Property name="hal.volume.is_mounted">
        <halevt:Action value="false" exec="halevt-mount -s"/>
    </halevt:Property>
</halevt:Device>

<!--
When a device is removed, it is recorded by halevt-mount.
!-->
<halevt:Device match="hal.block.device &amp; hal.block.is_volume = true">
     <halevt:Removal exec="halevt-umount -u $hal.udi$; halevt-umount -s"/>
</halevt:Device>


<!-- 
Example of a use of OnInit. At startup all the devices are matched and the exec
comand is run for those that match. Here we match all the removable devices
that aren't already mounted and mount and register them.
!-->

<halevt:Device match="&MOUNTABLE;">
   <halevt:OnInit exec="halevt-mount -u $hal.udi$ -o flush"/>
</halevt:Device>

<!-- 
Example of a use of Condition. When a device matches and the condition has become
true for that device, the corresponding exec command is launched.

<halevt:Device match="hal.info.udi = /org/freedesktop/Hal/devices/acpi_PWRF">
    <halevt:Condition name="ButtonPressed" exec="/usr/bin/sudo /sbin/shutdown"/>
</halevt:Device>

!-->

<!-- 
Example of a use of Condition with detail value attribute. This condition
differentiates between three different hotkeys for a ButtonPressed event
and performs the appropriate action for each.

<halevt:Device match="hal.input.originating_device.hal.info.linux.driver = atkbd">
    <halevt:Condition name="ButtonPressed" value="mute"        exec="amixer -q set Master toggle"/>
    <halevt:Condition name="ButtonPressed" value="volume-down" exec="amixer -q set Master 1-"/>
    <halevt:Condition name="ButtonPressed" value="volume-up"   exec="amixer -q set Master 1+"/>
</halevt:Device>
!-->

<!-- 
Example of a use of OnInit. At startup all the devices are matched and the exec
comand is run for those that match.

<halevt:Device match="hal.info.category = battery">
    <halevt:OnInit exec="hvbattery -u $hal.udi$ -l $hal.battery.charge_level.percentage$ -s $hal.battery.rechargeable.is_discharging"/>
</halevt:Device>
!-->


</halevt:Configuration>