Difference between revisions of "Halevt"

From ArchWiki
Jump to: navigation, search
(New path to traydevie's default.xml)
(wikify some external links, use https for archlinux.org)
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
==Introduction==
+
[[Category:Hardware detection and troubleshooting]]
 
This document describes a method to configure halevt and traydevice in order to mount removable media.
 
This document describes a method to configure halevt and traydevice in order to mount removable media.
  
 
==Installation==
 
==Installation==
First you need to install [http://aur.archlinux.org/packages.php?ID=24244 halevt] and [http://aur.archlinux.org/packages.php?ID=32005 traydevice] from [[AUR]].
+
First you need to [[Pacman|install]] {{AUR|halevt}} and {{AUR|traydevice}} from [[AUR]].
  
 
==Configuration==
 
==Configuration==
After that you need to install a halevt config in ~/.halevt/
+
After that you need to install a halevt config in {{ic|~/.halevt/}}:
  
  cp /usr/share/halevt/examples/umount_from_tray-gtkdialog.xml ~/.halevt/traydevice.xml
+
  $ cp /usr/share/halevt/examples/umount_from_tray-gtkdialog.xml ~/.halevt/traydevice.xml
  vim ~/.halevt/traydevice.xml
+
  $ vim ~/.halevt/traydevice.xml
  
 
Edit the relevant part into
 
Edit the relevant part into
Line 25: Line 25:
 
  </halevt:Device>
 
  </halevt:Device>
  
Next you need to edit the default.xml file of traydevice and change it to use halevt-mount instead of pmount-hal.
+
Next you need to edit the {{ic|default.xml}} file of traydevice and change it to use halevt-mount instead of pmount-hal.
  
  cp /usr/share/traydevice/default.xml ~/.config/traydevice/
+
  $ cp /usr/share/traydevice/default.xml ~/.config/traydevice/
  vim ~/.config/traydevice/default.xml
+
  $ vim ~/.config/traydevice/default.xml
  
 
Edit the relevant part into
 
Edit the relevant part into
Line 47: Line 47:
  
 
Finally you need to make halevt start when you login to X.
 
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.
+
Just add halevt to {{ic|~/.config/openbox/autostart}} if you are using [[Openbox]], or {{ic|~/.config/awesome/rc.lua}} for [[Awesome]].
  
 
==Tips and Tricks==
 
==Tips and Tricks==
Line 53: Line 53:
  
 
==Alternatives==
 
==Alternatives==
Instead of halevt you can use another program based on UDisks - [http://bbs.archlinux.org/viewtopic.php?pid=786153 UDisksEvt]. With the most recent version of Traydevice you can setup a complete hal-less (hal is deprecated after all) automounting system.
+
Instead of halevt you can use another program based on UDisks - [https://bbs.archlinux.org/viewtopic.php?pid=786153 UDisksEvt]. With the most recent version of Traydevice you can setup a complete hal-less (hal is deprecated after all) automounting system.
 
UDisksEvt example configuration file already contains appropriate setup for Traydevice, so it should work out-of-the-box.
 
UDisksEvt example configuration file already contains appropriate setup for Traydevice, so it should work out-of-the-box.

Revision as of 16:14, 4 December 2012

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

Installation

First you need to install halevtAUR and traydeviceAUR 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/share/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 ~/.config/openbox/autostart if you are using Openbox, or ~/.config/awesome/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.

Alternatives

Instead of halevt you can use another program based on UDisks - UDisksEvt. With the most recent version of Traydevice you can setup a complete hal-less (hal is deprecated after all) automounting system. UDisksEvt example configuration file already contains appropriate setup for Traydevice, so it should work out-of-the-box.