Difference between revisions of "Halevt"

From ArchWiki
Jump to: navigation, search
(Halevt is successor of Ivman, a program to execute commands when devices are added or removed.)
 
m (Configuration)
Line 21: Line 21:
  
 
  <halevt:Device match="&MOUNTABLE;">
 
  <halevt:Device match="&MOUNTABLE;">
   <halevt:Insertion exec="halevt-mount -u $hal.udi$ &amp;amp;&amp;amp; traydevice $hal.udi$"/>
+
   <halevt:Insertion exec="halevt-mount -u $hal.udi$ &amp;amp; traydevice $hal.udi$"/>
   <halevt:OnInit exec="halevt-mount -u $hal.udi$ &amp;amp;&amp;amp; traydevice $hal.udi$"/>
+
   <halevt:OnInit exec="halevt-mount -u $hal.udi$ &amp;amp; traydevice $hal.udi$"/>
 
  </halevt:Device>
 
  </halevt:Device>
  
Line 33: Line 33:
  
 
  <menuitem icon="gtk.STOCK_ADD" text="mount">
 
  <menuitem icon="gtk.STOCK_ADD" text="mount">
   <!-- execute command pmount-hal, passing it hal udi of managed device -->
+
   <!- - execute command pmount-hal, passing it hal udi of managed device -->
 
   <command executable="halevt-mount">
 
   <command executable="halevt-mount">
 
   <arg>-u</arg>
 
   <arg>-u</arg>
Line 40: Line 40:
 
and
 
and
  
  <menuitem icon="gtk.STOCK_ADD" text="mount">
+
<!- - execute command pumount, passing it device node from hal property -->
  <!-- execute command pmount-hal, passing it hal udi of managed device -->
+
  <menuitem icon="gtk.STOCK_REMOVE" text="umount">
   <command executable="halevt-mount">
+
   <command executable="halevt-umount">
 
   <arg>-u</arg>
 
   <arg>-u</arg>
 
   <ref>info.udi</ref>
 
   <ref>info.udi</ref>
 
  
 
Finally you need to make halevt start when you login to X.
 
Finally you need to make halevt start when you login to X.

Revision as of 12:25, 11 April 2010

Introduction

This document describes a method to configure halevt and traydevice in order to mount removable media.

Installation

First you need to install halevt and traydevice from AUR.

Configuration

After that you need to install a halevt config in ~/.halevt/

cp /usr/share/halevt/examples/umount_from_tray-gtkdialog.xml ~/.halevt/traydevice.xml
vim ~/.halevt/traydevice.xml

Edit the relevant part into

<halevt:Device match="&MOUNTABLE;">
 <halevt:Insertion exec="traydevice $hal.udi$"/>
 <halevt:OnInit exec="traydevice $hal.udi$"/>
</halevt:Device>

Or if you want it to automatically mount when plugging in then edit into

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

Next you need to edit the default.xml file of traydevice and change it to use halevt-mount instead of pmount-hal.

cp /usr/lib/python2.6/site-packages/traydevice/default.xml ~/.config/traydevice/
vim ~/.config/traydevice/default.xml

Edit the relevant part into

<menuitem icon="gtk.STOCK_ADD" text="mount">
 <!- - execute command pmount-hal, passing it hal udi of managed device -->
 <command executable="halevt-mount">
  <arg>-u</arg>
  <ref>info.udi</ref>

and

<!- - execute command pumount, passing it device node from hal property -->
<menuitem icon="gtk.STOCK_REMOVE" text="umount">
 <command executable="halevt-umount">
  <arg>-u</arg>
  <ref>info.udi</ref>

Finally you need to make halevt start when you login to X. Just add halevt to autostart.sh if you are using OpenBox, or rc.lua for awesome.

Tips and Tricks

It is better to start halevt individually per user rather than as a system daemon since it might conflict with other volume manager.